2016-05-17 03:04:11 +12:00
|
|
|
#pragma once
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
#ifndef TIDENTIFIABLE_INCLUDED
|
|
|
|
#define TIDENTIFIABLE_INCLUDED
|
|
|
|
|
|
|
|
#include "tutil.h"
|
|
|
|
|
|
|
|
#undef DVAPI
|
|
|
|
#undef DVVAR
|
|
|
|
#ifdef TNZCORE_EXPORTS
|
|
|
|
#define DVAPI DV_EXPORT_API
|
|
|
|
#define DVVAR DV_EXPORT_VAR
|
|
|
|
#else
|
|
|
|
#define DVAPI DV_IMPORT_API
|
|
|
|
#define DVVAR DV_IMPORT_VAR
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//=========================================================
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
class DVAPI TIdentifiable {
|
|
|
|
unsigned long m_id;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
public:
|
2016-06-15 18:43:10 +12:00
|
|
|
TIdentifiable();
|
|
|
|
virtual ~TIdentifiable();
|
|
|
|
TIdentifiable(const TIdentifiable &);
|
|
|
|
const TIdentifiable &operator=(const TIdentifiable &);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
unsigned long getIdentifier() const { return m_id; }
|
|
|
|
void setIdentifier(unsigned long id);
|
|
|
|
void setNewIdentifier();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
void storeByIdentifier();
|
|
|
|
static TIdentifiable *fetchByIdentifier(unsigned long id);
|
2016-03-19 06:57:51 +13:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|