86 virtual void read(std::istream& is) = 0;
92 virtual void write(std::ostream& os)
const = 0;
113 void setId(
unsigned long id);
std::ostream & operator<<(std::ostream &os, const BaseObject &o)
Operator overloading for passing the data from the BaseObject "o" into the output stream.
Definition: BaseObject.cc:36
std::istream & operator>>(std::istream &is, BaseObject &o)
Operator overloading for reading the data from an input stream into the BAseObject "o"
Definition: BaseObject.cc:47
It is an abstract base class due to the purely virtual functions declared below. Even if the function...
Definition: BaseObject.h:51
virtual std::string getName() const =0
A purely virtual function.
unsigned int groupId_
Identifier of a group within handler.
Definition: BaseObject.h:157
unsigned getGroupId() const
Definition: BaseObject.h:137
friend std::ostream & operator<<(std::ostream &os, const BaseObject &o)
A purely virtual method with an implementation which reads the index from the stream and assigns it t...
Definition: BaseObject.cc:36
unsigned int getId() const
Returns the unique identifier of any particular object.
Definition: BaseObject.h:125
unsigned int id_
unique identifier within handler (remains constant even if particle is moved)
Definition: BaseObject.h:149
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...
Definition: BaseObject.cc:91
unsigned int getIndex() const
Returns the index of the object in the handler.
Definition: BaseObject.h:118
BaseObject()=default
Default constructor.
void setIndex(unsigned int index)
Allows one to assign an index to an object in the handler/container.
Definition: BaseObject.cc:64
unsigned int index_
location in BaseHandler::objects_
Definition: BaseObject.h:144
void setGroupId(unsigned groupId)
Definition: BaseObject.h:131
friend std::istream & operator>>(std::istream &is, BaseObject &o)
Operator overloading for reading the data from an input stream into the BAseObject "o"
Definition: BaseObject.cc:47
virtual void moveInHandler(unsigned int index)
Except that it is virtual, it does the same thing as setIndex() does.
Definition: BaseObject.cc:56
virtual void read(std::istream &is)=0
Definition: BaseObject.cc:81
void setId(unsigned long id)
Assigns a unique identifier to each object in the handler (container) which remains constant even aft...
Definition: BaseObject.cc:72
BaseObject(const BaseObject &p)=default
Copy constructor, copies all the objects BaseObject contains.
virtual ~BaseObject()=default
virtual destructor