torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::generic::Nameable Class Reference

An object that has a name. More...

#include <Nameable.hpp>

+ Inheritance diagram for torc::generic::Nameable:
+ Collaboration diagram for torc::generic::Nameable:

Public Member Functions

virtual ~Nameable () throw ()
 
virtual const std::string getName () const
 
void setName (const std::string &inSource) throw (Error)
 

Protected Member Functions

 Nameable ()
 

Private Member Functions

 Nameable (const Nameable &source)
 
Nameableoperator= (const Nameable &source)
 

Private Attributes

std::string mName
 

Detailed Description

An object that has a name.

The Nameable class provides an interface for and implements functionality that allows an object of a derivd class to have a string name.

Definition at line 34 of file Nameable.hpp.

Constructor & Destructor Documentation

torc::generic::Nameable::Nameable ( )
explicitprotected

Definition at line 30 of file Nameable.cpp.

30 : mName() {}
torc::generic::Nameable::~Nameable ( )
throw (
)
virtual

Definition at line 32 of file Nameable.cpp.

32 {}
torc::generic::Nameable::Nameable ( const Nameable source)
private

Member Function Documentation

const std::string torc::generic::Nameable::getName ( void  ) const
inlinevirtual

Get the object name

Returns
Name of the object

Definition at line 89 of file Nameable.hpp.

89  {
90  return mName;
91 }

+ Here is the caller graph for this function:

Nameable& torc::generic::Nameable::operator= ( const Nameable source)
private
void torc::generic::Nameable::setName ( const std::string &  inSource)
throw (Error
)

Set a name for this object

Parameters
[in]inSourceName of the object
Exceptions
ErrorCould not set name, because name is empty (Will be used by array members)
  • Id : eMessageIdErrorEmptyItemName
  • Context Data

Set a name for this object

Parameters
[in]inSourceName of the object
Exceptions
ErrorCould not set name, because name is empty (Will be used by array members)

Definition at line 41 of file Nameable.cpp.

41  {
42  if(inSource.empty()) {
43  Error e(eMessageIdErrorEmptyItemName, __FUNCTION__, __FILE__, __LINE__);
44  e.saveContextData("Nameable", inSource);
45  throw e;
46  }
47  mName = inSource;
48 }

+ Here is the call graph for this function:

Field Documentation

std::string torc::generic::Nameable::mName
private

Definition at line 81 of file Nameable.hpp.


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