Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

AMOS::UniversalSet_t Class Reference

A non-redundant, complete collection of Universal objects. More...

#include <universals_AMOS.hh>

List of all members.

Public Member Functions

 UniversalSet_t ()
 Constructs a UniversalSet_t w/ default objects.
 ~UniversalSet_t ()
 Destroys a UniveralSet_t and its contained objects.
iterator begin ()
 Returns an iterator to the beginning of the set.
const_iterator begin () const
void clearAll ()
 Issues a clear command to each object in the set.
iterator end ()
 Returns an iterator to the end of the set.
const_iterator end () const
bool exists (NCode_t ncode)
 Checks if an object with a given NCode exists in the set.
Size_t getSize ()
 Returns the number of known universal objects.
Universal_toperator[] (NCode_t ncode)
 Returns a reference to the object with the given NCode.
const Universal_toperator[] (NCode_t ncode) const
Universal_toperator[] (const std::string &ncode)
const Universal_toperator[] (const std::string &ncode) const


Detailed Description

A non-redundant, complete collection of Universal objects.

Provides a non-redundant, complete collection of static Universal objects accessible by their NCode and iteration. Useful when all possible AMOS universal objects are required, but the exact makeup of objects is unknown. Objects stored in this set are static, and only destruced when the class is destructed. Objects are stored in order that will preserve the def-before-ref rule - meaning two objects A,B where B has a link to A will always appear in the order A,B when iterating through the set.

Definition at line 53 of file universals_AMOS.hh.


Constructor & Destructor Documentation

UniversalSet_t::UniversalSet_t  ) 
 

Constructs a UniversalSet_t w/ default objects.

Definition at line 21 of file universals_AMOS.cc.

References begin(), and end().

UniversalSet_t::~UniversalSet_t  ) 
 

Destroys a UniveralSet_t and its contained objects.

Definition at line 55 of file universals_AMOS.cc.

References begin(), and end().


Member Function Documentation

const_iterator AMOS::UniversalSet_t::begin  )  const [inline]
 

Definition at line 137 of file universals_AMOS.hh.

References begin().

iterator AMOS::UniversalSet_t::begin  )  [inline]
 

Returns an iterator to the beginning of the set.

Iterator on all the objects in the set. Operates just like a std::vector iterator, however it does not support iterator addition/subtraction or reverse iteration. Objects will always be ordered definition-before-reference, meaning if B refers to A, A will always appear before B when iterating forward.

Returns:
An iterator to the beginning of the set
Definition at line 136 of file universals_AMOS.hh.

Referenced by begin(), clearAll(), UniversalSet_t(), and ~UniversalSet_t().

void UniversalSet_t::clearAll  ) 
 

Issues a clear command to each object in the set.

Returns:
void
Definition at line 63 of file universals_AMOS.cc.

References begin(), and end().

const_iterator AMOS::UniversalSet_t::end  )  const [inline]
 

Definition at line 154 of file universals_AMOS.hh.

References end().

iterator AMOS::UniversalSet_t::end  )  [inline]
 

Returns an iterator to the end of the set.

Returns:
An iterator to the end of the set
Definition at line 153 of file universals_AMOS.hh.

Referenced by clearAll(), end(), exists(), operator[](), UniversalSet_t(), and ~UniversalSet_t().

bool AMOS::UniversalSet_t::exists NCode_t  ncode  )  [inline]
 

Checks if an object with a given NCode exists in the set.

Returns:
true if it exists, false otherwise
Definition at line 162 of file universals_AMOS.hh.

References end(), and AMOS::NCode_t.

Size_t AMOS::UniversalSet_t::getSize  )  [inline]
 

Returns the number of known universal objects.

Returns:
The number of objects in the set
Definition at line 173 of file universals_AMOS.hh.

References AMOS::Size_t.

const Universal_t& AMOS::UniversalSet_t::operator[] const std::string &  ncode  )  const [inline]
 

Definition at line 220 of file universals_AMOS.hh.

References AMOS::Encode(), and operator[]().

Universal_t& AMOS::UniversalSet_t::operator[] const std::string &  ncode  )  [inline]
 

Definition at line 213 of file universals_AMOS.hh.

References AMOS::Encode(), and operator[]().

const Universal_t& AMOS::UniversalSet_t::operator[] NCode_t  ncode  )  const [inline]
 

Definition at line 202 of file universals_AMOS.hh.

References AMOS_THROW_ARGUMENT, AMOS::Decode(), end(), and AMOS::NCode_t.

Universal_t& AMOS::UniversalSet_t::operator[] NCode_t  ncode  )  [inline]
 

Returns a reference to the object with the given NCode.

To call object-specific methods, it will be necessary to cast the return reference to the type of object you are expecting to be returned. e.g. `((Read_t &)set["RED"]).setType(Read_t::END)'. However, for virtual methods inherited from Universal_t, this casting is unnecessary.

Precondition:
The NCode exists in the set
Exceptions:
ArgumentException_t 
Returns:
Pointer to the object with the given NCode
Definition at line 191 of file universals_AMOS.hh.

References AMOS_THROW_ARGUMENT, AMOS::Decode(), end(), and AMOS::NCode_t.

Referenced by operator[]().


The documentation for this class was generated from the following files:
Generated on Tue May 17 15:19:52 2005 for libAMOS by doxygen 1.3.8