Show identity.h syntax highlighted
/***************************************************************************
identity.h
-------------------
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. *
* *
***************************************************************************/
#ifndef IDENTITY_H_INCLUDED
#define IDENTITY_H_INCLUDED
#include <ClanLib/core.h>
class CL_OutputSource;
class CL_InputSource;
/**
* Used to identify Entities consistently across machines.
*/
class Identity {
private:
/**
* The id number.
*/
cl_uint32 id;
/**
* The next id.
*/
static cl_uint32 next;
/**
* Constructor.
*/
explicit Identity(cl_uint32 i);
public:
/**
* Constructor.
*/
Identity();
/**
* Copy constructor.
*/
Identity(const Identity& i);
/**
* Equality.
*/
bool operator==(const Identity& i) const;
/**
* Inequality.
*/
bool operator!=(const Identity& i) const;
/**
* Put it into an output source.
*/
void inject(CL_OutputSource& os) const;
/**
* Read from an input source.
*/
static Identity extract(CL_InputSource& is);
};
#endif /* ndef IDENTITY_H_INCLUDED */
See more files for this project here