Contains the extracted data for a given description process. More...
#include <Pool.hxx>
Public Member Functions | |
DescriptionDataPool (const DescriptionScheme &scheme) | |
Constructs a desciption data pool. | |
~DescriptionDataPool () | |
void | SetNumberOfContexts (const std::string &scopeName, unsigned size) |
Sets how many values will the attributes on the specified scope have. | |
unsigned | GetNumberOfContexts (const std::string &scopeName) const |
void | Insert (const std::string &scopeName, unsigned pos) |
void | Remove (const std::string &scopeName, unsigned pos) |
void | InstantiateAttribute (const std::string &scopeName, const std::string &attributeName) |
template<typename AttributeType > | |
AttributeType * | GetWritePool (const std::string &scopeName, const std::string &attributeName) |
Returns a pointer to the C array of data with all the values for the specified attribute. | |
template<typename AttributeType > | |
const AttributeType * | GetReadPool (const std::string &scopeName, const std::string &attributeName) const |
Returns a pointer to the C array of data with all the values for the specified attribute. | |
bool | IsInstantiated (const std::string &scopeName, const std::string &attributeName) const |
const char * | GetClassName () const |
Return the class name. | |
void | StoreOn (Storage &storage) const |
Stores component's subitems on the given Storage. | |
void | LoadFrom (Storage &storage) |
Loads component's subitems from the given Storage. |
Contains the extracted data for a given description process.
Its structure conforms the one defined by a DescriptionScheme specified when constructed.
Data is stored for each attribute as a C array.
The values can be dumped and restored to and from an XML file.
Definition at line 40 of file Pool.hxx.
CLAM::DescriptionDataPool::DescriptionDataPool | ( | const DescriptionScheme & | scheme | ) | [inline] |
Constructs a desciption data pool.
By default all the scopes are size 0 and no attributes are instanciated.
scheme | the DescriptionScheme to be taken as specification. |
const char* CLAM::DescriptionDataPool::GetClassName | ( | ) | const [inline, virtual] |
unsigned CLAM::DescriptionDataPool::GetNumberOfContexts | ( | const std::string & | scopeName | ) | const [inline] |
Definition at line 67 of file Pool.hxx.
References CLAM_ASSERT, and CLAM::DescriptionScheme::GetScopeIndex().
const AttributeType* CLAM::DescriptionDataPool::GetReadPool | ( | const std::string & | scopeName, | |
const std::string & | attributeName | |||
) | const [inline] |
Returns a pointer to the C array of data with all the values for the specified attribute.
The C array lenght will be the GetScopeSize(scope) long.
Definition at line 123 of file Pool.hxx.
References CLAM_ASSERT, and CLAM::DescriptionScheme::GetScopeIndex().
AttributeType* CLAM::DescriptionDataPool::GetWritePool | ( | const std::string & | scopeName, | |
const std::string & | attributeName | |||
) | [inline] |
Returns a pointer to the C array of data with all the values for the specified attribute.
The C array lenght will be the GetScopeSize(scope) long. This methods allocates the array value the first time is invoqued for an attribute.
Definition at line 105 of file Pool.hxx.
References CLAM_ASSERT, and CLAM::DescriptionScheme::GetScopeIndex().
void CLAM::DescriptionDataPool::Insert | ( | const std::string & | scopeName, | |
unsigned | pos | |||
) | [inline] |
Definition at line 75 of file Pool.hxx.
References CLAM_ASSERT, and CLAM::DescriptionScheme::GetScopeIndex().
void CLAM::DescriptionDataPool::InstantiateAttribute | ( | const std::string & | scopeName, | |
const std::string & | attributeName | |||
) | [inline] |
Definition at line 89 of file Pool.hxx.
References CLAM_ASSERT, CLAM::DescriptionScope::GetIndex(), CLAM::DescriptionScheme::GetScope(), and CLAM::DescriptionScheme::GetScopeIndex().
bool CLAM::DescriptionDataPool::IsInstantiated | ( | const std::string & | scopeName, | |
const std::string & | attributeName | |||
) | const [inline] |
Definition at line 132 of file Pool.hxx.
References CLAM::DescriptionScheme::GetScopeIndex().
void CLAM::DescriptionDataPool::LoadFrom | ( | Storage & | storage | ) | [inline, virtual] |
Loads component's subitems from the given Storage.
storage | The given storage where the subitem will be loaded from |
Implements CLAM::Component.
Definition at line 149 of file Pool.hxx.
References CLAM::DescriptionScheme::GetScope(), and CLAM::Storage::Load().
void CLAM::DescriptionDataPool::Remove | ( | const std::string & | scopeName, | |
unsigned | pos | |||
) | [inline] |
Definition at line 81 of file Pool.hxx.
References CLAM_ASSERT, and CLAM::DescriptionScheme::GetScopeIndex().
void CLAM::DescriptionDataPool::SetNumberOfContexts | ( | const std::string & | scopeName, | |
unsigned | size | |||
) | [inline] |
Sets how many values will the attributes on the specified scope have.
Sets the number of contexts (ie. number of notes) for the given Scope (Note), so that every attribute registered for that scope will have a single value for each context.
Definition at line 60 of file Pool.hxx.
References CLAM::DescriptionScheme::GetScope(), and CLAM::DescriptionScheme::GetScopeIndex().
void CLAM::DescriptionDataPool::StoreOn | ( | Storage & | storage | ) | const [inline, virtual] |
Stores component's subitems on the given Storage.
storage | The given storage where the subitem will be stored |
Implements CLAM::Component.
Definition at line 141 of file Pool.hxx.
References CLAM::Storage::Store().