Thea
Public Member Functions | Protected Member Functions | List of all members
NamedObject Class Reference

An object wrapping a name string. More...

#include <NamedObject.hpp>

Inheritance diagram for NamedObject:
INamedObject ArpackEigenSolver CsparseLinearSolver StdLinearSolver BinaryInputStream BinaryOutputStream DynLib DcelMesh< VertexAttribute, HalfedgeAttribute, FaceAttribute > DisplayMesh GeneralMesh< VertexAttributeT, EdgeAttributeT, FaceAttributeT, AllocatorT > MeshGroup< MeshT > TextInputStream TextOutputStream

Public Member Functions

char const * getName () const
 Get the name of the object. More...
 
 NamedObject ()
 Default constructor. More...
 
 NamedObject (std::string const &name_)
 Initializing constructor. More...
 
 NamedObject (NamedObject const &src)
 Copy constructor. More...
 
NamedObjectoperator= (NamedObject const &src)
 Assignment operator. More...
 
int8 setName (char const *s)
 Set the name of the object from a C-style string. More...
 
virtual int8 setName (std::string const &s)
 Set the name of the object from a std::string. More...
 
 ~NamedObject ()
 Destructor. More...
 

Protected Member Functions

std::string const & getNameStr () const
 Access the name string directly, for efficiency. More...
 

Detailed Description

An object wrapping a name string.

IMPORTANT: Always inherit virtually from this class, i.e. use:

class MyClass : public NamedObject
{
...
};

This also means that a derived class in an inheritance hierarchy involving NamedObject must explicitly call the NamedObject constructor if it wants to initialize the name.

Definition at line 58 of file NamedObject.hpp.

Constructor & Destructor Documentation

Default constructor.

Definition at line 64 of file NamedObject.hpp.

NamedObject ( std::string const &  name_)

Initializing constructor.

Definition at line 67 of file NamedObject.hpp.

NamedObject ( NamedObject const &  src)

Copy constructor.

Definition at line 70 of file NamedObject.hpp.

Destructor.

Definition at line 73 of file NamedObject.hpp.

Member Function Documentation

char const* getName ( ) const
virtual

Get the name of the object.

Implements INamedObject.

Definition at line 78 of file NamedObject.hpp.

std::string const& getNameStr ( ) const
protected

Access the name string directly, for efficiency.

Definition at line 98 of file NamedObject.hpp.

NamedObject& operator= ( NamedObject const &  src)

Assignment operator.

Definition at line 76 of file NamedObject.hpp.

int8 setName ( char const *  s)
virtual

Set the name of the object from a C-style string.

Returns
True if the name was successfully set, else false (e.g. if the name is read-only). In the default implementation, the function always returns true.

Implements INamedObject.

Definition at line 86 of file NamedObject.hpp.

virtual int8 setName ( std::string const &  s)
virtual

Set the name of the object from a std::string.

Returns
True if the name was successfully set, else false (e.g. if the name is read-only). In the default implementation, the function always returns true.

Definition at line 94 of file NamedObject.hpp.


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