GCpp general purpose C++ library  version 1.0
GNamed Class Reference

#include <GNamed.hh>

Inheritance diagram for GNamed:
GItem GTreeNodeT< T > GSubItem GTreeBranchT< T > GTreeLeafT< T >

Public Member Functions

template<class Q >
bool IsInstanceOf () const
 
template<class Q >
bool IsInstanceOf ()
 
virtual GNamedClone () const
 
virtual const char * ClassName () const
 
 GNamed (const string &object_name="")
 
 GNamed (const GNamed &object)
 
virtual ~GNamed ()
 
GNamedoperator= (const GNamed &object)
 
virtual const string & Name () const
 
virtual string & Name ()
 
virtual string GetName () const
 
virtual string GetInfo () const
 
virtual void SetName (const string &object_name)
 
int Compare (const GNamed &object) const
 
int CompareDict (const GNamed &object) const
 
bool operator== (const GNamed &object) const
 
bool operator!= (const GNamed &object) const
 
bool operator< (const GNamed &object) const
 
bool operator> (const GNamed &object) const
 
bool operator<= (const GNamed &object) const
 
bool operator>= (const GNamed &object) const
 

Static Public Member Functions

static const char * StaticClassName ()
 

Protected Attributes

string name
 Object name.
 

Detailed Description

Base class for named objects.

Constructor & Destructor Documentation

GNamed::GNamed ( const string &  object_name = "")
inline

Default constructor.

Parameters
object_nameName of the object

References name.

GNamed::GNamed ( const GNamed object)
inline

Copy constructor

Parameters
objectObject to copy

References name.

GNamed::~GNamed ( )
inlinevirtual

Destructor.

Member Function Documentation

int GNamed::Compare ( const GNamed object) const
inline

Object names comparison function: it returns -1, 0 or 1 depending if the object name is lower, equal or bigger than the arguments name.

Parameters
objectobject to compare with

References GetName().

Referenced by GNamedListT< T >::__FindName(), operator!=(), operator<(), operator<=(), operator==(), operator>(), and operator>=().

int GNamed::CompareDict ( const GNamed object) const
inline

Alphabetical comparison function, with no distinction between upper and lower case, with no accents. Only if words are identical, the accents first, then upper/lower cases are tested.

Parameters
objectobject to compare with

References GetName().

Referenced by GNamedListT< T >::__FindName().

string GNamed::GetInfo ( ) const
inlinevirtual

Return an information about the object (for the base class, nothing more than the name).

Reimplemented in GItem, and GTreeLeafT< T >.

References name.

string GNamed::GetName ( ) const
inlinevirtual
template<class Q >
bool GNamed::IsInstanceOf ( ) const
inline

Macro from GCpp library that defines the following functions:

  • ClassName(): return the real class name of the object
  • StaticClassName(): return the used class name of the object (that may be a base class of the real object).
  • IsInstanceOf<T>(): return true if the current object is an instance of the template class name argument
  • Clone(): return an allocated copy of the object.
const string & GNamed::Name ( ) const
inlinevirtual

Return object name.

References name.

string & GNamed::Name ( )
inlinevirtual

Return object name.

References name.

bool GNamed::operator!= ( const GNamed object) const
inline

Comparison operator.

Parameters
objectobject to compare

References Compare(), and GetName().

bool GNamed::operator< ( const GNamed object) const
inline

Comparison operator.

Parameters
objectobject to compare

References Compare(), and GetName().

bool GNamed::operator<= ( const GNamed object) const
inline

Comparison operator.

Parameters
objectobject to compare

References Compare(), and GetName().

GNamed & GNamed::operator= ( const GNamed object)
inline

Affectation operator.

Parameters
objectObject to copy

References name.

bool GNamed::operator== ( const GNamed object) const
inline

Comparison operator.

Parameters
objectobject to compare

References Compare(), and GetName().

bool GNamed::operator> ( const GNamed object) const
inline

Comparison operator.

Parameters
objectobject to compare

References Compare(), and GetName().

bool GNamed::operator>= ( const GNamed object) const
inline

Comparison operator.

Parameters
objectobject to compare

References Compare(), and GetName().

void GNamed::SetName ( const string &  object_name)
inlinevirtual

Set a new object name.

Parameters
object_namenew object name

Reimplemented in GTreeLeafT< T >.

References name.

Referenced by GNamedListT< T >::__FindName(), and GTreeBranchT< T >::GTreeBranchT().


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