CLAM::DescriptionScope Class Reference

#include <DescriptionScope.hxx>

List of all members.


Detailed Description

Definition at line 51 of file DescriptionScope.hxx.


Public Types

typedef std::map< std::string,
unsigned
NamesMap
typedef std::vector
< AbstractAttribute * > 
Attributes

Public Member Functions

 DescriptionScope (const std::string &name)
 ~DescriptionScope ()
const std::string & GetName () const
template<typename AttributeType>
void Add (const std::string &name)
 Adds the scope an attribute named 'name' using the template parameter as the attribute type.
unsigned GetIndex (const std::string &name) const
 Returns the attribute index that can be used for fast access to the attribute in a spec or even .
unsigned GetIndexSafe (const std::string &name) const
 The same as GetIndex but it throws a catchable exception whenever the name is not available.
unsigned GetNAttributes () const
void * Allocate (unsigned attribute, unsigned size) const
void Deallocate (unsigned attribute, void *buffer) const
template<typename AttributeType>
void CheckType (unsigned attributeIndex, AttributeType *) const
const std::string & GetAttributeName (unsigned attributeIndex) const
const AbstractAttributeGetAttribute (unsigned int attribute) const

Member Typedef Documentation

typedef std::map<std::string, unsigned> CLAM::DescriptionScope::NamesMap

Definition at line 54 of file DescriptionScope.hxx.

Definition at line 55 of file DescriptionScope.hxx.


Constructor & Destructor Documentation

CLAM::DescriptionScope::DescriptionScope ( const std::string &  name  )  [inline]

Definition at line 61 of file DescriptionScope.hxx.

CLAM::DescriptionScope::~DescriptionScope (  ) 

Definition at line 6 of file DescriptionScope.cxx.


Member Function Documentation

const std::string& CLAM::DescriptionScope::GetName (  )  const [inline]

template<typename AttributeType>
void CLAM::DescriptionScope::Add ( const std::string &  name  )  [inline]

Adds the scope an attribute named 'name' using the template parameter as the attribute type.

  • AttributeType The type for the attribute
  • name The name for the new attribute

Definition at line 77 of file DescriptionScope.hxx.

References CLAM_ASSERT.

unsigned CLAM::DescriptionScope::GetIndex ( const std::string &  name  )  const [inline]

Returns the attribute index that can be used for fast access to the attribute in a spec or even .

Warning:
The index is not a confident reference after serialization.
Precondition:
the name should exists

Definition at line 92 of file DescriptionScope.hxx.

References CLAM_ASSERT.

Referenced by CLAM::ScopePool::GetReadPool(), CLAM::ScopePool::GetWritePool(), CLAM::DescriptionDataPool::InstantiateAttribute(), and CLAM::ScopePool::IsInstantiated().

unsigned CLAM::DescriptionScope::GetIndexSafe ( const std::string &  name  )  const [inline]

The same as GetIndex but it throws a catchable exception whenever the name is not available.

Definition at line 103 of file DescriptionScope.hxx.

unsigned CLAM::DescriptionScope::GetNAttributes (  )  const [inline]

void* CLAM::DescriptionScope::Allocate ( unsigned  attribute,
unsigned  size 
) const [inline]

Definition at line 116 of file DescriptionScope.hxx.

void CLAM::DescriptionScope::Deallocate ( unsigned  attribute,
void *  buffer 
) const [inline]

Definition at line 120 of file DescriptionScope.hxx.

template<typename AttributeType>
void CLAM::DescriptionScope::CheckType ( unsigned  attributeIndex,
AttributeType *   
) const [inline]

const std::string& CLAM::DescriptionScope::GetAttributeName ( unsigned  attributeIndex  )  const [inline]

Definition at line 131 of file DescriptionScope.hxx.

References CLAM_ASSERT.

const AbstractAttribute& CLAM::DescriptionScope::GetAttribute ( unsigned int  attribute  )  const [inline]


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

Generated on Tue Aug 12 22:33:47 2008 for CLAM by  doxygen 1.5.5