72 virtual void read(std::istream& is) = 0;
78 virtual void write(std::ostream& os)
const = 0;
83 virtual std::string
getName()
const = 0;
93 void setIndex(
const unsigned int index);
99 void setId(
const unsigned int id);
109 unsigned int getId()
const;
void setIndex(const unsigned int index)
Allows one to assign an index to an object in the handler/container.
unsigned int getId() const
Returns the unique identifier of any particular object.
unsigned int getIndex() const
Returns the index of the object in the handler.
virtual void moveInHandler(const unsigned int index)
Except that it is virtual, it does the same thing as setIndex() does.
It is an abstract base class due to the purely virtual functions declared below. Even if the function...
unsigned int index_
location in BaseHandler::objects_
std::ostream & operator<<(std::ostream &os, const BaseObject &o)
Operator overloading for passing the data from the BaseObject "o" into the output stream...
unsigned int id_
unique identifier within handler (remains constant even if particle is moved)
void setId(const unsigned int id)
Assigns a unique identifier to each object in the handler (container) which remains constant even aft...
virtual ~BaseObject()
virtual destructor
virtual std::string getName() const =0
A purely virtual function.
virtual void read(std::istream &is)=0
A purely virtual method with an implementation which reads the index from the stream and assigns it t...
std::istream & operator>>(std::istream &is, BaseObject &o)
Operator overloading for reading the data from an input stream into the BAseObject "o"...
BaseObject()
Default constructor.
virtual void write(std::ostream &os) const =0
A purely virtual function which has an implementation which writes the name and the object id_ to the...