copasi API  0.1
Public Types | Public Member Functions | Friends
CCopasiVector< CType > Class Template Reference

#include <CCopasiVector.h>

Inheritance diagram for CCopasiVector< CType >:
vector CCopasiContainer CCopasiObject CCopasiVectorN< CType > CCopasiVectorS< CType > CCopasiVectorNS< CType >

List of all members.

Public Types

typedef std::vector< CType * >
::value_type 
value_type
typedef std::vector< CType * >
::iterator 
iterator
typedef std::vector< CType * >
::const_iterator 
const_iterator

Public Member Functions

 CCopasiVector (const std::string &name="NoName", const CCopasiContainer *pParent=NULL, const unsigned C_INT32 &flag=CCopasiObject::Vector)
 CCopasiVector (const CCopasiVector< CType > &src, const CCopasiContainer *pParent=NULL)
virtual ~CCopasiVector ()
CCopasiVector< CType > & operator= (const CCopasiVector< CType > &rhs)
CCopasiVector< CType > & operator= (const std::vector< CType * > &rhs)
void deepCopy (const CCopasiVector< CType > &source)
iterator begin ()
const_iterator begin () const
iterator end ()
const_iterator end () const
virtual void cleanup ()
virtual bool add (const CType &src)
virtual void swap (const unsigned C_INT32 &indexFrom, const unsigned C_INT32 &indexTo)
virtual bool add (CType *src, bool adopt=false)
virtual void remove (const unsigned C_INT32 &index)
virtual bool remove (CCopasiObject *pObject)
const value_typeoperator[] (const unsigned C_INT32 &index) const
value_typeoperator[] (const unsigned C_INT32 &index)
virtual const CCopasiObjectgetObject (const CCopasiObjectName &name) const
virtual unsigned C_INT32 size () const
virtual void resize (const unsigned C_INT32 &newSize)
virtual void clear ()
virtual unsigned C_INT32 getIndex (const CCopasiObject *pObject) const

Friends

std::ostream & operator<< (std::ostream &os, const CCopasiVector< CType > &d)

template<class CType>
class CCopasiVector< CType >


Member Typedef Documentation

template<class CType>
typedef std::vector< CType * >::const_iterator CCopasiVector< CType >::const_iterator
template<class CType>
typedef std::vector< CType * >::iterator CCopasiVector< CType >::iterator
template<class CType>
typedef std::vector< CType * >::value_type CCopasiVector< CType >::value_type

Constructor & Destructor Documentation

template<class CType>
CCopasiVector< CType >::CCopasiVector ( const std::string &  name = "NoName",
const CCopasiContainer pParent = NULL,
const unsigned C_INT32 &  flag = CCopasiObject::Vector 
) [inline]

Default constructor

Parameters:
constconst std::string & name (Default: "NoName")
constCCopasiContainer * pParent (Default: NULL)
constunsigned C_INT32 & flag (Default: flag | CCopasiObject::Vector)
template<class CType>
CCopasiVector< CType >::CCopasiVector ( const CCopasiVector< CType > &  src,
const CCopasiContainer pParent = NULL 
) [inline]

Copy constructor

Parameters:
constCCopasiVector < CType > & src
constCCopasiContainer * pParent (Default: NULL)
template<class CType>
virtual CCopasiVector< CType >::~CCopasiVector ( ) [inline, virtual]

Destructor


Member Function Documentation

template<class CType>
virtual bool CCopasiVector< CType >::add ( const CType &  src) [inline, virtual]
template<class CType>
virtual bool CCopasiVector< CType >::add ( CType *  src,
bool  adopt = false 
) [inline, virtual]

Add an object to the end of the vector, if adobt is true the vector. becomes the parent of the object.

Parameters:
CType* src
constbool & adopt (Default: false)
Returns:
bool success
template<class CType>
iterator CCopasiVector< CType >::begin ( ) [inline]
template<class CType>
const_iterator CCopasiVector< CType >::begin ( ) const [inline]
template<class CType>
virtual void CCopasiVector< CType >::cleanup ( ) [inline, virtual]

Cleanup

Reimplemented in CReportDefinitionVector, and COutputDefinitionVector.

template<class CType>
virtual void CCopasiVector< CType >::clear ( ) [inline, virtual]
template<class CType>
void CCopasiVector< CType >::deepCopy ( const CCopasiVector< CType > &  source) [inline]

This creates a deep copy of the source, i.e., all objects are copied and the parent of these copies is the current vector.

Parameters:
constCCopasiVector< CType > & source
template<class CType>
iterator CCopasiVector< CType >::end ( ) [inline]
template<class CType>
const_iterator CCopasiVector< CType >::end ( ) const [inline]
template<class CType>
virtual unsigned C_INT32 CCopasiVector< CType >::getIndex ( const CCopasiObject pObject) const [inline, virtual]

Retrieve the index of the pointed to object in the vector. If the object is not found C_INVALID_INDEX is returned.

Parameters:
constCCopasiObject * pObject
Returns:
unsigned C_INT32 index
template<class CType>
virtual const CCopasiObject* CCopasiVector< CType >::getObject ( const CCopasiObjectName name) const [inline, virtual]
template<class CType>
CCopasiVector< CType >& CCopasiVector< CType >::operator= ( const CCopasiVector< CType > &  rhs) [inline]

Assignment operator. The effect of this operator is that both vectors will share the same objects. However, the parentship of the objects is not affected This means that the assigned vector must be used with some care.

Parameters:
constCCopasiVector< CType > & rhs
Returns:
CCopasiVector< CType > & lhs
template<class CType>
CCopasiVector< CType >& CCopasiVector< CType >::operator= ( const std::vector< CType * > &  rhs) [inline]
template<class CType>
const value_type& CCopasiVector< CType >::operator[] ( const unsigned C_INT32 &  index) const [inline]
template<class CType>
value_type& CCopasiVector< CType >::operator[] ( const unsigned C_INT32 &  index) [inline]
template<class CType>
virtual void CCopasiVector< CType >::remove ( const unsigned C_INT32 &  index) [inline, virtual]

Removes the index-th element from the vector

Parameters:
constunsigned C_INT32 & index
template<class CType>
virtual bool CCopasiVector< CType >::remove ( CCopasiObject pObject) [inline, virtual]

Removes the pointed to object from the vector

Parameters:
CCopasiObject* pObject
Returns:
bool success

Reimplemented from CCopasiContainer.

template<class CType>
virtual void CCopasiVector< CType >::resize ( const unsigned C_INT32 &  newSize) [inline, virtual]

Resizes the vector but does not create new member objects

Parameters:
constunsigned C_INT32 & newSize
template<class CType>
virtual unsigned C_INT32 CCopasiVector< CType >::size ( ) const [inline, virtual]

Retrieves the size of the vector

Returns:
unsigned C_INT32 size
template<class CType>
virtual void CCopasiVector< CType >::swap ( const unsigned C_INT32 &  indexFrom,
const unsigned C_INT32 &  indexTo 
) [inline, virtual]

Swap two objects in the vector.

Parameters:
constunsigned C_INT32 & indexFrom
constunsigned C_INT32 & indexTo

Friends And Related Function Documentation

template<class CType>
std::ostream& operator<< ( std::ostream &  os,
const CCopasiVector< CType > &  d 
) [friend]

ostream operator

Parameters:
std::ostream& os
constCCopasiVector<CType> & d
Returns:
std::ostream & os

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines