18 #ifndef __IDENTITY_H__
19 #define __IDENTITY_H__
28 namespace Victor {
namespace Biopool {
40 Identity(
const string& name =
"",
long number = 0);
51 bool operator !=(
const Identity& other)
const {
52 return !((*this) == other);
56 operator long()
const;
62 operator const string&()
const;
74 friend ostream& operator <<(ostream& os,
const Identity&
id);
76 friend istream& operator >>(istream& is,
Identity&
id);
90 Identity::Identity(
const string& s,
long n) : name(s) {
99 Identity::Identity(
const Identity& orig)
115 return number == other.number;
119 Identity::operator long()
const {
124 Identity::operator
const string&()
const {
138 if (_number >= counter)
148 operator <<(ostream& os,
const Identity&
id) {
149 return os <<
"(Id " <<
id.name <<
" " <<
id.number <<
" ) ";
154 operator >>(istream& is, Identity&
id) {
160 DEBUG_MSG(
"Identity::operator >> : bad input.");
162 is.clear(ios::badbit);
166 return is >>
id.name >>
id.number >> tag;
void setNumber(long _number)
Definition: Identity.h:136
void setName(string _name)
Definition: Identity.h:130
bool operator==(const Identity &other) const
Definition: Identity.h:114
Implements object id. With a "number" a "name" and a "counter".
Definition: Identity.h:36
Identity & operator=(const Identity &orig)
Definition: Identity.h:106