Show identity.cpp syntax highlighted
/***************************************************************************
identity.cpp
-------------------
begin : Tue Nov 19 2002
copyright : (C) 2002 by Brendon Higgins
email : freepop-devel@lists.sourceforge.net
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include <identity.h>
#include <ClanLib/network.h>
cl_uint32 Identity::next = 0;
Identity::Identity(): id(next++) {
}
Identity::Identity(cl_uint32 i): id(i) {
}
Identity::Identity(const Identity& i) {
id = i.id;
}
bool Identity::operator==(const Identity& i) const {
return id == i.id;
}
bool Identity::operator!=(const Identity& i) const {
return id != i.id;
}
void Identity::inject(CL_OutputSource& os) const {
os.write_uint32(id);
}
Identity Identity::extract(CL_InputSource& is) {
return Identity(is.read_uint32());
}
See more files for this project here