[Hdrflow-svn] SF.net SVN: hdrflow: [129] lib/openlibraries/src/openpluginlib
Status: Pre-Alpha
Brought to you by:
glslang
|
From: <gl...@us...> - 2007-05-19 23:40:56
|
Revision: 129
http://hdrflow.svn.sourceforge.net/hdrflow/?rev=129&view=rev
Author: glslang
Date: 2007-05-19 16:40:54 -0700 (Sat, 19 May 2007)
Log Message:
-----------
+ revert back pcos changes
Modified Paths:
--------------
lib/openlibraries/src/openpluginlib/pl/pcos/property.cpp
lib/openlibraries/src/openpluginlib/pl/pcos/property.hpp
lib/openlibraries/src/openpluginlib/pl/pcos/property_container.cpp
lib/openlibraries/src/openpluginlib/pl/pcos/subject.hpp
lib/openlibraries/src/openpluginlib/py/pcos/property.cpp
lib/openlibraries/src/openpluginlib/py/pcos/subject.cpp
Modified: lib/openlibraries/src/openpluginlib/pl/pcos/property.cpp
===================================================================
--- lib/openlibraries/src/openpluginlib/pl/pcos/property.cpp 2007-05-19 18:42:13 UTC (rev 128)
+++ lib/openlibraries/src/openpluginlib/pl/pcos/property.cpp 2007-05-19 23:40:54 UTC (rev 129)
@@ -12,6 +12,7 @@
#include <openpluginlib/pl/utf8_utils.hpp>
#include <openpluginlib/pl/pcos/property.hpp>
#include <openpluginlib/pl/pcos/subject.hpp>
+#include <openpluginlib/pl/pcos/property_container.hpp>
namespace opl = olib::openpluginlib;
@@ -563,6 +564,7 @@
property_impl* result = new property_impl( key_ );
result->value = value;
result->always_notify = always_notify;
+ result->container_ = container_;
return result;
}
@@ -571,6 +573,7 @@
any value;
bool always_notify;
subject subject_;
+ property_container container_;
};
property property::NULL_PROPERTY;
@@ -612,6 +615,21 @@
impl_->subject_.unblock( obs );
}
+property property::get_property_with_string( const char* k ) const
+{
+ return impl_->container_.get_property_with_string( k );
+}
+
+property property::get_property_with_key( const key& k ) const
+{
+ return impl_->container_.get_property_with_key( k );
+}
+
+key_vector property::get_keys() const
+{
+ return impl_->container_.get_keys();
+}
+
property* property::clone() const
{
property* result = new property( get_key() );
@@ -693,6 +711,7 @@
void property::accept( visitor& v )
{
v.visit_property( *this );
+ v.visit_property_container( impl_->container_ );
}
bool property::valid() const
Modified: lib/openlibraries/src/openpluginlib/pl/pcos/property.hpp
===================================================================
--- lib/openlibraries/src/openpluginlib/pl/pcos/property.hpp 2007-05-19 18:42:13 UTC (rev 128)
+++ lib/openlibraries/src/openpluginlib/pl/pcos/property.hpp 2007-05-19 23:40:54 UTC (rev 129)
@@ -57,6 +57,11 @@
void block( boost::shared_ptr< observer > );
void unblock( boost::shared_ptr< observer > );
+ // iproperty_container interface
+ property get_property_with_string( const char* k ) const;
+ property get_property_with_key( const key& k ) const;
+ key_vector get_keys( ) const;
+
// clonable interface
property* clone( ) const;
Modified: lib/openlibraries/src/openpluginlib/pl/pcos/property_container.cpp
===================================================================
--- lib/openlibraries/src/openpluginlib/pl/pcos/property_container.cpp 2007-05-19 18:42:13 UTC (rev 128)
+++ lib/openlibraries/src/openpluginlib/pl/pcos/property_container.cpp 2007-05-19 23:40:54 UTC (rev 129)
@@ -20,17 +20,17 @@
class forwarding_observer : public observer
{
public:
- forwarding_observer( subject* forwardTo )
+ forwarding_observer( isubject* forwardTo )
: forwardTo_( forwardTo )
- { }
+ {}
- virtual void updated(isubject* )
+ virtual void updated( isubject* )
{
forwardTo_->update();
}
private:
- subject* forwardTo_;
+ isubject* forwardTo_;
};
/// inner class
Modified: lib/openlibraries/src/openpluginlib/pl/pcos/subject.hpp
===================================================================
--- lib/openlibraries/src/openpluginlib/pl/pcos/subject.hpp 2007-05-19 18:42:13 UTC (rev 128)
+++ lib/openlibraries/src/openpluginlib/pl/pcos/subject.hpp 2007-05-19 23:40:54 UTC (rev 129)
@@ -17,30 +17,30 @@
/// A standard subject to be part of the observer pattern.
/// The observer pointers are held by shared references.
-class OPENPLUGINLIB_DECLSPEC subject// : public isubject
+class OPENPLUGINLIB_DECLSPEC subject : public isubject
{
public:
- explicit subject();
+ subject();
virtual ~subject();
//// attach an observer to this subject
- virtual void attach( boost::shared_ptr< observer > );
+ void attach( boost::shared_ptr< observer > );
/// detach an observer from this subject
- virtual void detach( boost::shared_ptr< observer > );
+ void detach( boost::shared_ptr< observer > );
/// notify all observers
- virtual void update();
+ void update();
/// block notification for an observer; this is
/// a counted block operation i.e. if you call
/// block n times on the same observer, no
/// notification will be given until unblock()
/// has been called a matching number of times.
- virtual void block( boost::shared_ptr< observer > );
+ void block( boost::shared_ptr< observer > );
/// unblock notification for an observer
- virtual void unblock( boost::shared_ptr< observer > );
+ void unblock( boost::shared_ptr< observer > );
private:
subject& operator=( const subject& );
Modified: lib/openlibraries/src/openpluginlib/py/pcos/property.cpp
===================================================================
--- lib/openlibraries/src/openpluginlib/py/pcos/property.cpp 2007-05-19 18:42:13 UTC (rev 128)
+++ lib/openlibraries/src/openpluginlib/py/pcos/property.cpp 2007-05-19 23:40:54 UTC (rev 129)
@@ -164,6 +164,11 @@
.def( "is_a_uint_list", is_a_uint_list )
.def( "is_a_double_list", is_a_double_list )
.def( "is_a_bool", is_a_bool )
+ .def( "get_property", &pcos::property::get_property_with_string, py::return_value_policy< py::return_by_value >() )
+ .def( "get_property", &pcos::property::get_property_with_key, py::return_value_policy< py::return_by_value >() )
+ .def( "get_keys", &pcos::property::get_keys )
+// .def( "append", &pcos::property::append )
+// .def( "remove", &pcos::property::remove )
.def( "accept", &pcos::property::accept )
.def( "clone", &pcos::property::clone, py::return_value_policy< py::manage_new_object >() );
}
Modified: lib/openlibraries/src/openpluginlib/py/pcos/subject.cpp
===================================================================
--- lib/openlibraries/src/openpluginlib/py/pcos/subject.cpp 2007-05-19 18:42:13 UTC (rev 128)
+++ lib/openlibraries/src/openpluginlib/py/pcos/subject.cpp 2007-05-19 23:40:54 UTC (rev 129)
@@ -20,11 +20,11 @@
class isubject_wrap : public pcos::isubject, public py::wrapper< pcos::isubject >
{
public:
- void attach( boost::shared_ptr< pcos::observer > o ) { py::call<void>(this->get_override("attach").ptr(), o ); }
- void detach( boost::shared_ptr< pcos::observer > o ) { py::call<void>(this->get_override("detach").ptr(), o ); }
- void update() { py::call<void>(this->get_override("update").ptr()); }
- void block( boost::shared_ptr< pcos::observer > o ) { py::call<void>(this->get_override("block").ptr(), o ); }
- void unblock( boost::shared_ptr< pcos::observer > o ) { py::call<void>(this->get_override("unblock").ptr(), o ); }
+ void attach( boost::shared_ptr< pcos::observer > o ) { py::call<void>(this->get_override("attach").ptr(), o ); }
+ void detach( boost::shared_ptr< pcos::observer > o ) { py::call<void>(this->get_override("detach").ptr(), o ); }
+ void update() { py::call<void>(this->get_override("update").ptr()); }
+ void block( boost::shared_ptr< pcos::observer > o ) { py::call<void>(this->get_override("block").ptr(), o ); }
+ void unblock( boost::shared_ptr< pcos::observer > o ) { py::call<void>(this->get_override("unblock").ptr(), o ); }
};
void py_pcos_subject()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|