MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BaseObject.h File Reference
#include <iostream>

Go to the source code of this file.

Classes

class  BaseObject
 It is an abstract base class due to the purely virtual functions declared below. Even if the function is purely virtual, it does not imply that it cannot have a definition. Abstract classes are useful to define a interface. More...
 

Functions

std::ostream & operator<< (std::ostream &os, const BaseObject &o)
 Operator overloading for passing the data from the BaseObject "o" into the output stream. More...
 
std::istream & operator>> (std::istream &is, BaseObject &o)
 Operator overloading for reading the data from an input stream into the BAseObject "o". More...
 

Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const BaseObject o 
)

Operator overloading for passing the data from the BaseObject "o" into the output stream.

A purely virtual method with an implementation which reads the index from the stream and assigns it to id_.

Parameters
[in]is
[in,out]os
[in]o
Returns
std::ostream &
Parameters
[in,out]os
[in]o
Returns
std::ostream &

Definition at line 36 of file BaseObject.cc.

References BaseObject::write().

37 {
38  o.write(os);
39  return os;
40 }
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
std::istream& operator>> ( std::istream &  is,
BaseObject o 
)

Operator overloading for reading the data from an input stream into the BAseObject "o".

Parameters
[in]o
[in,out]is
Returns
std::istream&

Definition at line 47 of file BaseObject.cc.

References BaseObject::read().

48 {
49  o.read(is);
50  return (is);
51 }
virtual void read(std::istream &is)=0
Definition: BaseObject.cc:81