summaryrefslogtreecommitdiff
path: root/include/gras/detail/property.hpp
diff options
context:
space:
mode:
authorJosh Blum2013-03-17 12:32:43 -0700
committerJosh Blum2013-03-17 12:32:43 -0700
commit4e19b066d27b90355657688f67b6e2f208390a82 (patch)
treef72809037a62f883f1a60acddb3115e376da889a /include/gras/detail/property.hpp
parentb142e0e75f8ab4e7b2bb70c3fc71b61fd5f71651 (diff)
downloadsandhi-4e19b066d27b90355657688f67b6e2f208390a82.tar.gz
sandhi-4e19b066d27b90355657688f67b6e2f208390a82.tar.bz2
sandhi-4e19b066d27b90355657688f67b6e2f208390a82.zip
gras: property implementation in lib
Diffstat (limited to 'include/gras/detail/property.hpp')
-rw-r--r--include/gras/detail/property.hpp25
1 files changed, 8 insertions, 17 deletions
diff --git a/include/gras/detail/property.hpp b/include/gras/detail/property.hpp
index 467fb70..fd13025 100644
--- a/include/gras/detail/property.hpp
+++ b/include/gras/detail/property.hpp
@@ -3,19 +3,23 @@
#ifndef INCLUDED_GRAS_DETAIL_PROPERTY_HPP
#define INCLUDED_GRAS_DETAIL_PROPERTY_HPP
+#include <gras/gras.hpp>
#include <PMC/PMC.hpp>
+#include <boost/shared_ptr.hpp>
namespace gras
{
-struct PropertyRegistry
+struct GRAS_API PropertyRegistry
{
- PropertyRegistry(void){}
- ~PropertyRegistry(void){}
+ PropertyRegistry(void);
+ virtual ~PropertyRegistry(void);
virtual void set(const PMCC &) = 0;
virtual PMCC get(void) = 0;
};
+typedef boost::shared_ptr<PropertyRegistry> PropertyRegistrySptr;
+
template <typename ClassType, typename ValueType>
struct PropertyRegistryImpl : PropertyRegistry
{
@@ -28,7 +32,7 @@ struct PropertyRegistryImpl : PropertyRegistry
_getter(getter),
_setter(setter)
{}
- ~PropertyRegistryImpl(void){}
+ virtual ~PropertyRegistryImpl(void){}
void set(const PMCC &value)
{
@@ -45,19 +49,6 @@ struct PropertyRegistryImpl : PropertyRegistry
void(ClassType::*_setter)(const ValueType &);
};
-struct PropertyInterface
-{
- virtual void property_interface_register(
- const std::string &key,
- boost::shared_ptr<PropertyRegistry> pr
- ) = 0;
-
- virtual void property_interface_set(const std::string &key, const PMCC &value) = 0;
-
- virtual PMCC property_interface_get(const std::string &key) = 0;
-
-};
-
} //namespace gras
#endif /*INCLUDED_GRAS_DETAIL_PROPERTY_HPP*/