#ifndef BU_CACHABLE_H #define BU_CACHABLE_H namespace Bu { class Cachable { public: Cachable(); virtual ~Cachable(); virtual long getCacheId() const =0; }; template long getCacheId( const obtype *o ); template<> long getCacheId( const Cachable *o ); }; #define DECL_CACHABLE( name ) \ namespace Bu { template<> long getCacheId( const name *o ); } #define DEF_CACHABLE( name ) \ template<> long Bu::getCacheId( const name *o ) \ { \ return getCacheId( (Bu::Cachable *)o ); \ } #endif