#include <contentpackage.hh>
Inheritance diagram for RVL::ContentPackage< DataType, MetaType >:
Public Member Functions | |
ContentPackage (const ContentPackage< DataType, MetaType > &bin) | |
copy constructor - deep copy, assumes const word length for DataType returned by sizeof. | |
ContentPackage () | |
main constructor | |
virtual | ~ContentPackage () |
bool | initialize (MetaType const &_md, LocalDataContainer< DataType > *p=NULL, size_t start=0) |
post-construction initialization - can only be done once! Optional reference to external storage permits a CP to act as a "view" of another hunk of memory. | |
bool | isInitialized () const |
initialization status query | |
ContentPackage< DataType, MetaType > & | operator= (ContentPackage< DataType, MetaType > const &src) |
assignment | |
bool | operator== (ContentPackage< DataType, MetaType > const &a) const |
comparison | |
bool | operator!= (ContentPackage< DataType, MetaType > const &a) const |
bool | isCompatible (ContentPackage< DataType, MetaType > const &a) const |
MetaType & | getMetadata () |
access metadata, mutable | |
MetaType const & | getMetadata () const |
access metadata, const | |
size_t | getSize () const |
access data array size | |
DataType * | getData () |
access data, mutable | |
DataType const * | getData () const |
access data, const | |
ostream & | write (ostream &str) const |
The only requirement on DataType:
must have static size - and object of type DataType must have a definite size known at compile time - and possess a default constructor which allocates a memory block of constant, definite size - sizeof(DataType) must make sense, and actually give the size in bytes of a word of type DataType. Essentially the only possibilities are an intrinsic type or a struct made out of intrinsic types or a struct made out of such structs or...
The only requirements on MetaType:
a deep copy constructor;
correct behaviour of the getDataSize<MetaType>() helper function, if necessary by template specialization, returning the size of the DataType array specified by a MetaType object.
These assumptions are implicit in the presumption that all information necessary to initialize and define the behaviour of an object of this type is present in the MetaType data member and the DataType type specification..
This class follows the "initialization separate from instantiation" paradigm. The added flexibility is useful eg. in distributed computing - a recipient object can be constructed before the data it is to receive has been transmitted. Since the MetaType data member determines the size of the DataType array, the alternative paradigm would require some kind of auxiliary factory object.
Definition at line 202 of file contentpackage.hh.
RVL::ContentPackage< DataType, MetaType >::ContentPackage | ( | const ContentPackage< DataType, MetaType > & | bin | ) |
copy constructor - deep copy, assumes const word length for DataType returned by sizeof.
Definition at line 214 of file contentpackage.hh.
RVL::ContentPackage< DataType, MetaType >::ContentPackage | ( | ) |
virtual RVL::ContentPackage< DataType, MetaType >::~ContentPackage | ( | ) | [virtual] |
Definition at line 238 of file contentpackage.hh.
bool RVL::ContentPackage< DataType, MetaType >::initialize | ( | MetaType const & | _md, | |
LocalDataContainer< DataType > * | p = NULL , |
|||
size_t | start = 0 | |||
) |
post-construction initialization - can only be done once! Optional reference to external storage permits a CP to act as a "view" of another hunk of memory.
Definition at line 258 of file contentpackage.hh.
Referenced by RVL::SingleDataContainer< Datatype, Metatype >::initialize().
bool RVL::ContentPackage< DataType, MetaType >::isInitialized | ( | ) | const |
initialization status query
Definition at line 290 of file contentpackage.hh.
Referenced by RVL::SingleDataContainer< Datatype, Metatype >::getMetadata().
ContentPackage<DataType,MetaType>& RVL::ContentPackage< DataType, MetaType >::operator= | ( | ContentPackage< DataType, MetaType > const & | src | ) |
bool RVL::ContentPackage< DataType, MetaType >::operator== | ( | ContentPackage< DataType, MetaType > const & | a | ) | const |
comparison
Definition at line 309 of file contentpackage.hh.
Referenced by RVL::ContentPackage< Datatype, Metatype >::operator!=().
bool RVL::ContentPackage< DataType, MetaType >::operator!= | ( | ContentPackage< DataType, MetaType > const & | a | ) | const |
Definition at line 318 of file contentpackage.hh.
bool RVL::ContentPackage< DataType, MetaType >::isCompatible | ( | ContentPackage< DataType, MetaType > const & | a | ) | const |
Definition at line 322 of file contentpackage.hh.
MetaType& RVL::ContentPackage< DataType, MetaType >::getMetadata | ( | ) |
access metadata, mutable
Definition at line 327 of file contentpackage.hh.
Referenced by RVL::SingleDataContainer< Datatype, Metatype >::getMetadata(), and RVL::ContentPackage< Datatype, Metatype >::isCompatible().
MetaType const& RVL::ContentPackage< DataType, MetaType >::getMetadata | ( | ) | const |
size_t RVL::ContentPackage< DataType, MetaType >::getSize | ( | ) | const [virtual] |
access data array size
Implements RVL::LocalDataContainer< DataType >.
Definition at line 349 of file contentpackage.hh.
Referenced by RVL::ContentPackage< Datatype, Metatype >::operator==(), and RVL::ContentPackage< Datatype, Metatype >::write().
DataType* RVL::ContentPackage< DataType, MetaType >::getData | ( | ) | [virtual] |
access data, mutable
Implements RVL::LocalDataContainer< DataType >.
Definition at line 355 of file contentpackage.hh.
Referenced by RVL::ContentPackage< Datatype, Metatype >::operator==().
DataType const* RVL::ContentPackage< DataType, MetaType >::getData | ( | ) | const [virtual] |
access data, const
Implements RVL::LocalDataContainer< DataType >.
Definition at line 365 of file contentpackage.hh.
ostream& RVL::ContentPackage< DataType, MetaType >::write | ( | ostream & | str | ) | const [virtual] |
Implements RVL::Writeable.
Definition at line 375 of file contentpackage.hh.
Referenced by RVL::SingleDataContainer< Datatype, Metatype >::write().