Program: bbtk
Module: $RCSfile: bbtkAny.h,v $
Language: C++
- Date: $Date: 2008/01/22 15:02:00 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2008/02/20 16:05:38 $
+ Version: $Revision: 1.2 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See doc/license.txt or
class anyholder<ValueType*> : public anyplaceholder
{
public: // structors
-
+
anyholder(ValueType* const & value)
: held(value)
{ }
-
+
public: // queries
-
+
virtual const std::type_info & type() const
{
return typeid(ValueType*);
}
-
+
virtual bool is_pointer() const { return true; }
virtual const std::type_info & pointed_type() const { return typeid(ValueType); }
virtual void* get_pointer() const {
}
virtual anyplaceholder * clone() const { return new anyholder(held); }
-
+
public: // representation
-
+
ValueType* held;
-
+
};
//=========================================================
public:
typedef any< TypeTraits > self;
// structors
-
+
/// Default constructor
any()
: content(0)
{
}
-
+
/// Constructor with a value of template type
template<typename ValueType>
any(const ValueType & value)
{
delete content;
}
-
+
/// Swaps the content of this with another any
any & swap(any & rhs)