The Vish Visualization Shell 0.3
Vish
Classes | Public Member Functions | List of all members
MemCore::Loader< X > Class Template Referenceabstract

Abstract base class for object loaders, which are used by the LoaderRegistry. More...

#include <elementary/memcore/Loader.hpp>

Inheritance diagram for MemCore::Loader< X >:
MemCore::LoaderBase MemCore::ReferenceBase< LoaderBase > MemCore::Attributes

Classes

struct  ldrpar
 An internal helper class, used for type-specific reduction, holds a ref ptr to the actual object to be modified during the load process. More...
 

Public Member Functions

virtual RefPtr< Xload (const RefPtr< LoaderParameters > &, const RefPtr< X > &Xptr=NullPtr())=0
 
 Loader ()
 Constructor (does nothing)
 
- Public Member Functions inherited from MemCore::LoaderBase
virtual bool loadable (const RefPtr< LoaderParameters > &) const =0
 Check wether this specific URL might be handled by this loader.
 
- Public Member Functions inherited from MemCore::ReferenceBase< LoaderBase >
auto getObjectCountID () const noexcept
 Get a unique ID for this object in the given domain.
 
bool isIdentical (const WeakPtr< LoaderBase, LoaderBase > &PossibleSelf) const noexcept
 Check if this object is identical to the one used by the given pointer.
 
void mkAutoDestructive ()
 Marks this object as being automatically destructed, e.g.
 
refcount_t refcount () const noexcept
 The strong reference count.
 
 ReferenceBase (LoaderBase *that) noexcept
 Constructor, initializes reference counter to zero.
 
const auto & self () const
 Return weak pointer to the object self.
 
refcount_t wrefcount () const noexcept
 The weak reference count.
 
- Public Member Functions inherited from MemCore::Attributes
 Attributes ()
 Default constructor.
 
MemCore::RefPtr< MemCore::ChunkBasegetAttribute (const std::string &name) const
 get an attribute by name
 
const AgeablegetAttributeAge () const
 Get the age of these attributes.
 
template<class T >
std::pair< bool, T > getAttributeValue (const string &AttributeName, size_t ElementNumber=0) const
 Get a single value from an attribute, use structured binding for most compact syntax such as:
 
attributes_t & getAttributeValues ()
 allow direct access to internal map
 
const attributes_t & getAttributeValues () const
 allow direct access to internal map
 
size_t getNumberOfAttributes () const
 Retrieve the number of attributes.
 
bool hasAttribute (const std::string &name) const
 Check if an attribute exists.
 
template<class Functor >
int Iterate (const Functor &L) const
 
int iterate (Iterator &it) const
 Iterate over attributes and apply iterator's apply function for each attribute, i.e.
 
template<class Functor >
int iterate_attributes (const Functor &L) const
 
size_t NumberOfAttributes () const
 Retrieve the number of attributes.
 
void setAttribute (const std::string &name, const MemCore::RefPtr< MemCore::ChunkBase > &AttribData)
 set an attribute
 
template<class T >
ResizableChunk< T > & setAttributeValue (const std::string &name, const T &AttribData)
 set a single attribute
 
template<class T >
ResizableChunk< T > & setAttributeValues (const std::string &name, const std::initializer_list< T > &AttribData)
 set an attribute
 
template<class T >
const T & setValue (const T &AttribData, const std::string &name)
 Convenience function: set an single attribute, return the value itself.
 
template<class T >
const T & setValue (const T &AttribData, const std::string &name, const std::string &Comment, const std::string &CommentPrefix="Comment")
 Convenience function: set an single attribute with a comment, return the value itself.
 
string toString () const
 Convert attributes to string.
 
const AgeabletouchAttributes () const
 Touch the attribute age to indicate some values in the attributes have been changed.
 
const AgeableupdateAttributeAge (const Ageable &A) const
 Update the attribute age to another age to indicate some values in the attributes have been changed.
 
 ~Attributes ()
 Destructor.
 

Additional Inherited Members

- Public Types inherited from MemCore::ReferenceBase< LoaderBase >
using reference_domain_t = LoaderBase
 The type of the base class.
 
using SelfPtr_t = WeakPtr< LoaderBase, LoaderBase >
 Type for a pointer to this object itself.
 
- Protected Member Functions inherited from MemCore::LoaderBase
 LoaderBase ()
 Constructor.
 
virtual ~LoaderBase ()=0
 Destructor.
 
- Protected Member Functions inherited from MemCore::ReferenceBase< LoaderBase >
virtual void extremeUnction ()
 A virtual function that will be called just before the object is destroyed.
 
ReferenceBaseoperator= (const ReferenceBase &R)
 Protected assignment operator (should not be called).
 
void suicide ()
 Delete this.
 
virtual ~ReferenceBase ()
 Virtual destructor.
 

Detailed Description

template<class X>
class MemCore::Loader< X >

Abstract base class for object loaders, which are used by the LoaderRegistry.

A Loader implements the functionality to load and create an object of type X from some input source. However, while a specific loader may be used to do so, the actual generic loading of objects is done via the LoaderRegistry abstraction class.

Member Function Documentation

◆ load()

template<class X >
virtual RefPtr< X > MemCore::Loader< X >::load ( const RefPtr< LoaderParameters > &  ,
const RefPtr< X > &  Xptr = NullPtr() 
)
pure virtual
Parameters
XptrAn eventually already existing data container object. If the pointer is non-zero, then data are intended to be appended or replaced.

References MemCore::Loader< X >::load().

Referenced by MemCore::Loader< X >::load().