Main Page | Class Hierarchy | Data Structures | File List | Data Fields | Globals

Property.hpp

Go to the documentation of this file.
00001 // vim:sw=2:ts=8
00017 #ifndef ABSTRACT_PROPERTY__HPP
00018 #define ABSTRACT_PROPERTY__HPP
00019 
00020 #include "boost/graph/adjacency_list.hpp"
00021 
00022 
00023 namespace gns {
00024 
00025 
00033   class AbstractProperty
00034   {
00035     public:
00037       AbstractProperty() {};
00039       virtual ~AbstractProperty() {};
00041       virtual AbstractProperty* clone() const =0;
00043       virtual std::string get_type() const =0;
00044   };
00045 
00046 
00054   template< class T >
00055     class Property : public AbstractProperty
00056     {
00057       public:
00059         typedef T property_type;
00061         T val;
00062 
00064         Property() {};
00065 
00067         Property(T v) : val(v) { };
00068 
00070         Property(const Property<T>& prop) : AbstractProperty(), val(prop.val) { };
00071 
00073         virtual ~Property() {};
00074 
00076         virtual Property<T>* clone() const { return new Property<T>(*this); };
00077 
00079         virtual std::string get_type() const { return typeid(val).name(); };
00080     };
00081 
00082 }
00083 
00084 #endif

Generated on Sun Nov 5 12:05:19 2006 for Graph by  doxygen 1.4.1