CLAM-Development  1.4.0
Public Member Functions
CLAM::DescriptionDataPool Class Reference

Contains the extracted data for a given description process. More...

#include <Pool.hxx>

List of all members.

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.
- Public Member Functions inherited from CLAM::Component
virtual ~Component ()
virtual ComponentShallowCopy () const
virtual ComponentDeepCopy () const

Detailed Description

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.


Constructor & Destructor Documentation

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.

Parameters:
schemethe DescriptionScheme to be taken as specification.

Definition at line 48 of file Pool.hxx.

CLAM::DescriptionDataPool::~DescriptionDataPool ( )

Definition at line 5 of file Pool.cxx.


Member Function Documentation

const char* CLAM::DescriptionDataPool::GetClassName ( ) const
inlinevirtual

Return the class name.

Implements CLAM::Component.

Definition at line 140 of file Pool.hxx.

unsigned CLAM::DescriptionDataPool::GetNumberOfContexts ( const std::string &  scopeName) const
inline
template<typename AttributeType >
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.

Precondition:
Such attribute in such scope exists and the type is the one in the template.
GetWritePool, which allocates the data, has been previously called for this attribute and pool object.

Definition at line 123 of file Pool.hxx.

References CLAM_ASSERT, and CLAM::DescriptionScheme::GetScopeIndex().

template<typename AttributeType >
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.

Precondition:
Such attribute in such scope exists and the type is the one in the template.

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
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)
inlinevirtual

Loads component's subitems from the given Storage.

Parameters:
storageThe given storage where the subitem will be loaded from
See also:
Storage

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
inlinevirtual

Stores component's subitems on the given Storage.

Parameters:
storageThe given storage where the subitem will be stored
See also:
Storage

Implements CLAM::Component.

Definition at line 141 of file Pool.hxx.

References CLAM::Storage::Store().


The documentation for this class was generated from the following files: