/* HA-ID.hpp - generic hash based and hierarchically typed ID Copyright (C) Lumiera.org 2009, Hermann Vosseler 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. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /** @file ha-id.hpp ** ** @see HaID_test ** @see Placement usage example ** */ #ifndef LIB_HA_ID_H #define LIB_HA_ID_H //#include "pre.hpp" //#include "proc/mobject/session/locatingpin.hpp" //#include "proc/asset/pipe.hpp" //#include namespace lib { // using std::tr1::shared_ptr; /** @todo WIP a generic hash-index, maybe also usable for assets */ struct LuidH { long dummy_; }; template struct HaID; template struct HaIndexed { LuidH id_; HaID const& getID() const; }; template struct HaID : LuidH { HaID () : LuidH () {} HaID (BA const& ref) : LuidH (ref.getID()) {} }; template struct HaID : HaID { HaID () : HaID () {} HaID (T const& ref) : HaID (ref) {} }; template inline HaID const& HaIndexed::getID() const { return *(static_cast*> (&id_)); } struct Base { int ii_; }; struct TestA : Base, HaIndexed { }; struct TestBA : TestA {}; struct TestBB : TestA {}; /** */ class PlacementRef { public: /** * */ class ID { }; template class IDp : public ID { }; }; } // namespace lib #endif