Boost logo

Boost-Commit :

From: jmcintyre_at_[hidden]
Date: 2007-12-03 19:01:48


Author: jared
Date: 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
New Revision: 41671
URL: http://svn.boost.org/trac/boost/changeset/41671

Log:
Began removing existing metadata implementation and brought the file names up to boost spec for the files I expect to keep. Heavy changes to unit tests.
Added:
   sandbox/pinhole/boost/pinhole/BoolEditor.hpp
      - copied, changed from r41666, /sandbox/pinhole/boost/pinhole/BoolEditor.h
   sandbox/pinhole/boost/pinhole/DoubleEditor.hpp
      - copied, changed from r41666, /sandbox/pinhole/boost/pinhole/DoubleEditor.h
   sandbox/pinhole/boost/pinhole/Editor.hpp
      - copied, changed from r41666, /sandbox/pinhole/boost/pinhole/Editor.h
   sandbox/pinhole/boost/pinhole/EditorTypeFinder.hpp
      - copied, changed from r41666, /sandbox/pinhole/boost/pinhole/EditorTypeFinder.h
   sandbox/pinhole/boost/pinhole/FloatEditor.hpp
      - copied, changed from r41666, /sandbox/pinhole/boost/pinhole/FloatEditor.h
   sandbox/pinhole/boost/pinhole/IntegerEditor.hpp
      - copied, changed from r41666, /sandbox/pinhole/boost/pinhole/IntegerEditor.h
   sandbox/pinhole/boost/pinhole/StringEditor.hpp
      - copied, changed from r41666, /sandbox/pinhole/boost/pinhole/StringEditor.h
   sandbox/pinhole/boost/pinhole/action_info.hpp
      - copied, changed from r41666, /sandbox/pinhole/boost/pinhole/action_info.h
   sandbox/pinhole/boost/pinhole/exceptions.hpp
      - copied unchanged from r41666, /sandbox/pinhole/boost/pinhole/exceptions.h
   sandbox/pinhole/boost/pinhole/find.hpp
      - copied, changed from r41666, /sandbox/pinhole/boost/pinhole/find.h
   sandbox/pinhole/boost/pinhole/map_key_value_iterators.hpp
      - copied unchanged from r41666, /sandbox/pinhole/boost/pinhole/map_key_value_iterators.h
   sandbox/pinhole/boost/pinhole/property_group.hpp
      - copied, changed from r41666, /sandbox/pinhole/boost/pinhole/property_group.h
   sandbox/pinhole/boost/pinhole/property_group_wrapper.hpp
      - copied, changed from r41666, /sandbox/pinhole/boost/pinhole/property_group_wrapper.h
   sandbox/pinhole/boost/pinhole/property_info.hpp
      - copied, changed from r41666, /sandbox/pinhole/boost/pinhole/property_info.h
   sandbox/pinhole/boost/pinhole/property_manager.hpp
      - copied, changed from r41666, /sandbox/pinhole/boost/pinhole/property_manager.h
   sandbox/pinhole/libs/pinhole/test/TestClassesAndConstants.hpp
      - copied, changed from r41666, /sandbox/pinhole/libs/pinhole/test/TestClassesAndConstants.h
   sandbox/pinhole/libs/pinhole/test/UtilityMisc.hpp
      - copied unchanged from r41666, /sandbox/pinhole/libs/pinhole/test/UtilityMisc.h
   sandbox/pinhole/libs/pinhole/test/test_actions.cpp
      - copied, changed from r41666, /sandbox/pinhole/libs/pinhole/test/TestActions.cpp
   sandbox/pinhole/libs/pinhole/test/test_bool_properties.cpp
      - copied, changed from r41666, /sandbox/pinhole/libs/pinhole/test/TestBoolProperties.cpp
   sandbox/pinhole/libs/pinhole/test/test_double_properties.cpp
      - copied, changed from r41666, /sandbox/pinhole/libs/pinhole/test/TestDoubleProperties.cpp
   sandbox/pinhole/libs/pinhole/test/test_float_properties.cpp
      - copied, changed from r41666, /sandbox/pinhole/libs/pinhole/test/TestFloatProperties.cpp
   sandbox/pinhole/libs/pinhole/test/test_integer_properties.cpp
      - copied, changed from r41666, /sandbox/pinhole/libs/pinhole/test/TestIntegerProperties.cpp
   sandbox/pinhole/libs/pinhole/test/test_property_group_wrapper.cpp
      - copied, changed from r41666, /sandbox/pinhole/libs/pinhole/test/TestPropertyGroupWrapper.cpp
   sandbox/pinhole/libs/pinhole/test/test_property_groups.cpp
      - copied, changed from r41666, /sandbox/pinhole/libs/pinhole/test/TestPropertyGroups.cpp
   sandbox/pinhole/libs/pinhole/test/test_string_properties.cpp
      - copied, changed from r41666, /sandbox/pinhole/libs/pinhole/test/TestStringProperties.cpp
Removed:
   sandbox/pinhole/boost/pinhole/BoolEditor.h
   sandbox/pinhole/boost/pinhole/DoubleEditor.h
   sandbox/pinhole/boost/pinhole/Editor.h
   sandbox/pinhole/boost/pinhole/EditorTypeFinder.h
   sandbox/pinhole/boost/pinhole/FloatEditor.h
   sandbox/pinhole/boost/pinhole/IntegerEditor.h
   sandbox/pinhole/boost/pinhole/StringEditor.h
   sandbox/pinhole/boost/pinhole/action_info.h
   sandbox/pinhole/boost/pinhole/exceptions.h
   sandbox/pinhole/boost/pinhole/find.h
   sandbox/pinhole/boost/pinhole/map_key_value_iterators.h
   sandbox/pinhole/boost/pinhole/property_group.h
   sandbox/pinhole/boost/pinhole/property_group_wrapper.h
   sandbox/pinhole/boost/pinhole/property_info.h
   sandbox/pinhole/boost/pinhole/property_manager.h
   sandbox/pinhole/libs/pinhole/test/TestActions.cpp
   sandbox/pinhole/libs/pinhole/test/TestBoolProperties.cpp
   sandbox/pinhole/libs/pinhole/test/TestClassesAndConstants.h
   sandbox/pinhole/libs/pinhole/test/TestDoubleProperties.cpp
   sandbox/pinhole/libs/pinhole/test/TestFloatProperties.cpp
   sandbox/pinhole/libs/pinhole/test/TestIntegerProperties.cpp
   sandbox/pinhole/libs/pinhole/test/TestPropertyGroupWrapper.cpp
   sandbox/pinhole/libs/pinhole/test/TestPropertyGroups.cpp
   sandbox/pinhole/libs/pinhole/test/TestStringProperties.cpp
   sandbox/pinhole/libs/pinhole/test/UtilityMisc.h
Text files modified:
   sandbox/pinhole/boost/pinhole/BoolEditor.hpp | 2
   sandbox/pinhole/boost/pinhole/DoubleEditor.hpp | 2
   sandbox/pinhole/boost/pinhole/Editor.hpp | 1
   sandbox/pinhole/boost/pinhole/EditorTypeFinder.hpp | 16 ++-
   sandbox/pinhole/boost/pinhole/FloatEditor.hpp | 2
   sandbox/pinhole/boost/pinhole/IntegerEditor.hpp | 2
   sandbox/pinhole/boost/pinhole/StringEditor.hpp | 21 +++++
   sandbox/pinhole/boost/pinhole/action_info.hpp | 2
   sandbox/pinhole/boost/pinhole/find.hpp | 2
   sandbox/pinhole/boost/pinhole/main.cpp | 6
   sandbox/pinhole/boost/pinhole/property_group.hpp | 16 ++--
   sandbox/pinhole/boost/pinhole/property_group_wrapper.hpp | 2
   sandbox/pinhole/boost/pinhole/property_info.hpp | 9 +-
   sandbox/pinhole/boost/pinhole/property_manager.hpp | 4
   sandbox/pinhole/libs/pinhole/test/Jamfile.v2 | 16 ++--
   sandbox/pinhole/libs/pinhole/test/TestClassesAndConstants.hpp | 14 +-
   sandbox/pinhole/libs/pinhole/test/test_actions.cpp | 2
   sandbox/pinhole/libs/pinhole/test/test_bool_properties.cpp | 155 +++++++++++++++++++++++++++------------
   sandbox/pinhole/libs/pinhole/test/test_double_properties.cpp | 108 ++++++++++++++-------------
   sandbox/pinhole/libs/pinhole/test/test_float_properties.cpp | 124 ++++++++++++++-----------------
   sandbox/pinhole/libs/pinhole/test/test_integer_properties.cpp | 118 +++++++++++++----------------
   sandbox/pinhole/libs/pinhole/test/test_property_group_wrapper.cpp | 4
   sandbox/pinhole/libs/pinhole/test/test_property_groups.cpp | 4
   sandbox/pinhole/libs/pinhole/test/test_string_properties.cpp | 99 ++++++++++++-------------
   24 files changed, 397 insertions(+), 334 deletions(-)

Deleted: sandbox/pinhole/boost/pinhole/BoolEditor.h
==============================================================================
--- sandbox/pinhole/boost/pinhole/BoolEditor.h 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
+++ (empty file)
@@ -1,35 +0,0 @@
-// MscProperty system BoolEditor.h file
-//
-// Copyright Jared McIntyre 2007.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_BOOLEDITOR
-#define BOOST_BOOLEDITOR
-
-#include "Editor.h"
-
-namespace boost { namespace pinhole
-{
- class BoolEditor : public Editor
- {
- public:
- BoolEditor(EditorControlType controlType=Radio)
- {
- m_UItype = controlType;
- }
-
- ~BoolEditor() {;}
-
- /**
- * Retrieves the type of the property for the editor.
- */
- EditorPropertyType getEditorPropertyType() const
- {
- return( BooleanType );
- }
- };
-}}
-
-#endif // include guard
\ No newline at end of file

Copied: sandbox/pinhole/boost/pinhole/BoolEditor.hpp (from r41666, /sandbox/pinhole/boost/pinhole/BoolEditor.h)
==============================================================================
--- /sandbox/pinhole/boost/pinhole/BoolEditor.h (original)
+++ sandbox/pinhole/boost/pinhole/BoolEditor.hpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
@@ -8,7 +8,7 @@
 #ifndef BOOST_BOOLEDITOR
 #define BOOST_BOOLEDITOR
 
-#include "Editor.h"
+#include "Editor.hpp"
 
 namespace boost { namespace pinhole
 {

Deleted: sandbox/pinhole/boost/pinhole/DoubleEditor.h
==============================================================================
--- sandbox/pinhole/boost/pinhole/DoubleEditor.h 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
+++ (empty file)
@@ -1,84 +0,0 @@
-// MscProperty system DoubleEditor.h file
-//
-// Copyright Jared McIntyre 2007.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_DOUBLEEDITOR
-#define BOOST_DOUBLEEDITOR
-
-#include "Editor.h"
-
-namespace boost { namespace pinhole
-{
- class DoubleEditor : public Editor
- {
- public:
- DoubleEditor()
- {
- m_UItype = EditBox;
- }
-
- DoubleEditor( double dLowRange,
- double dHighRange,
- double dIncrement=0.5,
- EditorControlType controlType=EditBox ) :
- m_dLowRange( dLowRange ),
- m_dHighRange( dHighRange ),
- m_dIncrement( dIncrement ),
- m_bHasRange( true )
- {
- m_UItype = controlType;
- }
-
-
- ~DoubleEditor() {;}
-
- /**
- * Retrieves the low range of the property for the editor.
- */
- double getLowRange() const
- {
- return( m_dLowRange );
- }
-
- /**
- * Retrieves the high range of the property for the editor.
- */
- double getHighRange() const
- {
- return( m_dHighRange );
- }
-
- /**
- * Retrieves the increment of the property for the editor.
- */
- double getIncrement() const
- {
- return( m_dIncrement );
- }
-
- /**
- * Retrieves the flag to use range of the property for the editor.
- */
- bool UseRange() const
- {
- return( m_bHasRange );
- }
-
- /**
- * Retrieves the type of the property for the editor.
- */
- EditorPropertyType getEditorPropertyType() const
- {
- return( DoubleType );
- }
-
- private:
- double m_dLowRange, m_dHighRange, m_dIncrement;
- bool m_bHasRange;
- };
-}}
-
-#endif // include guard
\ No newline at end of file

Copied: sandbox/pinhole/boost/pinhole/DoubleEditor.hpp (from r41666, /sandbox/pinhole/boost/pinhole/DoubleEditor.h)
==============================================================================
--- /sandbox/pinhole/boost/pinhole/DoubleEditor.h (original)
+++ sandbox/pinhole/boost/pinhole/DoubleEditor.hpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
@@ -8,7 +8,7 @@
 #ifndef BOOST_DOUBLEEDITOR
 #define BOOST_DOUBLEEDITOR
 
-#include "Editor.h"
+#include "Editor.hpp"
 
 namespace boost { namespace pinhole
 {

Deleted: sandbox/pinhole/boost/pinhole/Editor.h
==============================================================================
--- sandbox/pinhole/boost/pinhole/Editor.h 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
+++ (empty file)
@@ -1,121 +0,0 @@
-// MscProperty system Editor.h file
-//
-// Copyright Jared McIntyre 2007.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_EDITOR
-#define BOOST_EDITOR
-
-#include <map>
-#include <string>
-
-using namespace std;
-//using namespace boost;
-
-namespace boost { namespace pinhole
-{
- enum EditorPropertyType
- {
- StringType,
- IntegerType,
- BooleanType,
- FloatType,
- DoubleType
- };
-
- enum EditorControlType
- {
- None=0,
- EditBox=1,
- Tracker=2,
- DropDown=3,
- Radio=4,
- UpDown=5
- };
-
- class Editor
- {
- public:
- typedef std::map<std::string, std::string> property_collection;
- typedef property_collection::size_type size_type;
- typedef property_collection::iterator iterator;
- typedef property_collection::const_iterator const_iterator;
-
- /**
- * Constructor which creates a default editor that is defined as
- * no editor.
- */
- Editor() : m_UItype(EditBox) {;}
-
- /**
- * Constructor that created an editor of the specified type.
- * @param type The editor to use.
- */
- Editor(EditorControlType type)
- {
- m_UItype = type;
- }
-
- /**
- * Destructor
- */
- virtual ~Editor() {;}
-
- /**
- * Retrieves the type of the editor to use.
- */
- EditorControlType GetControlType() const
- {
- return m_UItype;
- }
-
- /**
- * Sets a property for the editor. Properties are simple key/value
- * string pairs that are used by the editor to make decision. Each
- * editor has a different set of properties that it will read.
- * @param key The property key.
- * @param value The property value.
- */
- Editor& operator()( std::string key, std::string value )
- {
- m_properties.insert( make_pair(key,value) );
-
- return *this;
- }
-
- /**
- * Overloaded operator equal.
- * @param editor The Editor class to copy.
- */
- virtual Editor& operator=( const Editor& editor )
- {
- m_UItype = editor.m_UItype;
-
- m_properties.clear();
- m_properties.insert( editor.m_properties.begin(), editor.m_properties.end() );
-
- return *this;
- }
-
-
- /**
- * Retrieves the type of the property for the editor.
- */
- virtual EditorPropertyType getEditorPropertyType() const = 0;
-
- protected:
- EditorControlType m_UItype;
- #if defined(BOOST_MSVC)
- #pragma warning(push)
- #pragma warning( disable: 4251 )
- #endif
- property_collection m_properties;
- #if defined(BOOST_MSVC)
- #pragma warning(pop)
- #endif
- };
-}}
-
-#endif // include guard
\ No newline at end of file

Copied: sandbox/pinhole/boost/pinhole/Editor.hpp (from r41666, /sandbox/pinhole/boost/pinhole/Editor.h)
==============================================================================
--- /sandbox/pinhole/boost/pinhole/Editor.h (original)
+++ sandbox/pinhole/boost/pinhole/Editor.hpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
@@ -19,6 +19,7 @@
     enum EditorPropertyType
     {
         StringType,
+ WStringType,
         IntegerType,
         BooleanType,
         FloatType,

Deleted: sandbox/pinhole/boost/pinhole/EditorTypeFinder.h
==============================================================================
--- sandbox/pinhole/boost/pinhole/EditorTypeFinder.h 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
+++ (empty file)
@@ -1,64 +0,0 @@
-// MscProperty system EditorTypeFinder.h file
-//
-// Copyright Jared McIntyre 2007.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_DETAIL_EDITORTYPEFINDER
-#define BOOST_DETAIL_EDITORTYPEFINDER
-
-#include <boost/mpl/void.hpp>
-#include "BoolEditor.h"
-#include "DoubleEditor.h"
-#include "FloatEditor.h"
-#include "IntegerEditor.h"
-#include "StringEditor.h"
-
-namespace boost { namespace pinhole { namespace detail
-{
-
- template<typename Value_Type>
- struct EditorTypeFinder
- {
- typedef boost::mpl::void_ type;
- };
-
- template<>
- struct EditorTypeFinder<bool>
- {
- typedef BoolEditor type;
- };
-
- template<>
- struct EditorTypeFinder<double>
- {
- typedef DoubleEditor type;
- };
-
- template<>
- struct EditorTypeFinder<float>
- {
- typedef FloatEditor type;
- };
-
- template<>
- struct EditorTypeFinder<int>
- {
- typedef IntegerEditor type;
- };
-
- template<>
- struct EditorTypeFinder<time_t>
- {
- typedef IntegerEditor type;
- };
-
- template<>
- struct EditorTypeFinder<std::string>
- {
- typedef StringEditor type;
- };
-}}}
-
-#endif // include guard
\ No newline at end of file

Copied: sandbox/pinhole/boost/pinhole/EditorTypeFinder.hpp (from r41666, /sandbox/pinhole/boost/pinhole/EditorTypeFinder.h)
==============================================================================
--- /sandbox/pinhole/boost/pinhole/EditorTypeFinder.h (original)
+++ sandbox/pinhole/boost/pinhole/EditorTypeFinder.hpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
@@ -9,11 +9,11 @@
 #define BOOST_DETAIL_EDITORTYPEFINDER
 
 #include <boost/mpl/void.hpp>
-#include "BoolEditor.h"
-#include "DoubleEditor.h"
-#include "FloatEditor.h"
-#include "IntegerEditor.h"
-#include "StringEditor.h"
+#include "BoolEditor.hpp"
+#include "DoubleEditor.hpp"
+#include "FloatEditor.hpp"
+#include "IntegerEditor.hpp"
+#include "StringEditor.hpp"
 
 namespace boost { namespace pinhole { namespace detail
 {
@@ -59,6 +59,12 @@
     {
         typedef StringEditor type;
     };
+
+ template<>
+ struct EditorTypeFinder<std::wstring>
+ {
+ typedef WStringEditor type;
+ };
 }}}
 
 #endif // include guard
\ No newline at end of file

Deleted: sandbox/pinhole/boost/pinhole/FloatEditor.h
==============================================================================
--- sandbox/pinhole/boost/pinhole/FloatEditor.h 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
+++ (empty file)
@@ -1,83 +0,0 @@
-// MscProperty system FloatEditor.h file
-//
-// Copyright Jared McIntyre 2007.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_FLOATEDITOR
-#define BOOST_FLOATEDITOR
-
-#include "Editor.h"
-
-namespace boost { namespace pinhole
-{
- class FloatEditor : public Editor
- {
- public:
- FloatEditor()
- {
- m_UItype = EditBox;
- };
-
- FloatEditor( float fLowRange,
- float fHighRange,
- float fIncrement=0.5,
- EditorControlType controlType=EditBox ) :
- m_fLowRange( fLowRange ),
- m_fHighRange( fHighRange ),
- m_fIncrement( fIncrement )
- {
- m_UItype = controlType;
- m_bHasRange = true;
- }
-
- ~FloatEditor() {;}
-
- /**
- * Retrieves the low range of the property for the editor.
- */
- float getLowRange() const
- {
- return( m_fLowRange );
- }
-
- /**
- * Retrieves the high range of the property for the editor.
- */
- float getHighRange() const
- {
- return( m_fHighRange );
- }
-
- /**
- * Retrieves the increment of the property for the editor.
- */
- float getIncrement() const
- {
- return( m_fIncrement );
- }
-
- /**
- * Retrieves the flag to use range of the property for the editor.
- */
- bool UseRange() const
- {
- return( m_bHasRange );
- }
-
- /**
- * Retrieves the type of the property for the editor.
- */
- EditorPropertyType getEditorPropertyType() const
- {
- return( FloatType );
- }
-
- private:
- float m_fLowRange, m_fHighRange, m_fIncrement;
- bool m_bHasRange;
- };
-}}
-
-#endif // include guard
\ No newline at end of file

Copied: sandbox/pinhole/boost/pinhole/FloatEditor.hpp (from r41666, /sandbox/pinhole/boost/pinhole/FloatEditor.h)
==============================================================================
--- /sandbox/pinhole/boost/pinhole/FloatEditor.h (original)
+++ sandbox/pinhole/boost/pinhole/FloatEditor.hpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
@@ -8,7 +8,7 @@
 #ifndef BOOST_FLOATEDITOR
 #define BOOST_FLOATEDITOR
 
-#include "Editor.h"
+#include "Editor.hpp"
 
 namespace boost { namespace pinhole
 {

Deleted: sandbox/pinhole/boost/pinhole/IntegerEditor.h
==============================================================================
--- sandbox/pinhole/boost/pinhole/IntegerEditor.h 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
+++ (empty file)
@@ -1,85 +0,0 @@
-// MscProperty system IntegerEditor.h file
-//
-// Copyright Jared McIntyre 2007.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_INTEGEREDITOR
-#define BOOST_INTEGEREDITOR
-
-#include "Editor.h"
-
-namespace boost { namespace pinhole
-{
- class IntegerEditor : public Editor
- {
- public:
- IntegerEditor()
- {
- m_UItype = EditBox;
- m_bHasRange = false;
- }
-
- IntegerEditor( int iLowRange,
- int iHighRange,
- int iIncrement=0,
- EditorControlType controlType=EditBox ) :
- m_iLowRange( iLowRange ),
- m_iHighRange( iHighRange ),
- m_iIncrement( iIncrement )
- {
- m_UItype = controlType;
- m_bHasRange = true;
- }
-
- virtual ~IntegerEditor() {;}
-
-
- /**
- * Retrieves the low range of the property for the editor.
- */
- int getLowRange() const
- {
- return( m_iLowRange );
- }
-
- /**
- * Retrieves the high range of the property for the editor.
- */
- int getHighRange() const
- {
- return( m_iHighRange );
- }
-
- /**
- * Retrieves the increment of the property for the editor.
- */
- int getIncrement() const
- {
- return( m_iIncrement );
- }
-
- /**
- * Retrieves the flag to use range of the property for the editor.
- */
- bool UseRange() const
- {
- return( m_bHasRange );
- }
-
- /**
- * Retrieves the type of the property for the editor.
- */
- EditorPropertyType getEditorPropertyType() const
- {
- return( IntegerType );
- }
-
- private:
- int m_iLowRange, m_iHighRange, m_iIncrement;
- bool m_bHasRange;
- };
-}}
-
-#endif // include guard
\ No newline at end of file

Copied: sandbox/pinhole/boost/pinhole/IntegerEditor.hpp (from r41666, /sandbox/pinhole/boost/pinhole/IntegerEditor.h)
==============================================================================
--- /sandbox/pinhole/boost/pinhole/IntegerEditor.h (original)
+++ sandbox/pinhole/boost/pinhole/IntegerEditor.hpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
@@ -8,7 +8,7 @@
 #ifndef BOOST_INTEGEREDITOR
 #define BOOST_INTEGEREDITOR
 
-#include "Editor.h"
+#include "Editor.hpp"
 
 namespace boost { namespace pinhole
 {

Deleted: sandbox/pinhole/boost/pinhole/StringEditor.h
==============================================================================
--- sandbox/pinhole/boost/pinhole/StringEditor.h 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
+++ (empty file)
@@ -1,35 +0,0 @@
-// MscProperty system StringEditor.h file
-//
-// Copyright Jared McIntyre 2007.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_STRINGEDITOR
-#define BOOST_STRINGEDITOR
-
-#include "Editor.h"
-
-namespace boost { namespace pinhole
-{
- class StringEditor : public Editor
- {
- public:
- StringEditor()
- {
- m_UItype = EditBox;
- }
-
- ~StringEditor() {;}
-
- /**
- * Retrieves the type of the property for the editor.
- */
- EditorPropertyType getEditorPropertyType() const
- {
- return( StringType );
- }
- };
-}}
-
-#endif // include guard
\ No newline at end of file

Copied: sandbox/pinhole/boost/pinhole/StringEditor.hpp (from r41666, /sandbox/pinhole/boost/pinhole/StringEditor.h)
==============================================================================
--- /sandbox/pinhole/boost/pinhole/StringEditor.h (original)
+++ sandbox/pinhole/boost/pinhole/StringEditor.hpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
@@ -8,7 +8,7 @@
 #ifndef BOOST_STRINGEDITOR
 #define BOOST_STRINGEDITOR
 
-#include "Editor.h"
+#include "Editor.hpp"
 
 namespace boost { namespace pinhole
 {
@@ -30,6 +30,25 @@
             return( StringType );
         }
     };
+
+ class WStringEditor : public Editor
+ {
+ public:
+ WStringEditor()
+ {
+ m_UItype = EditBox;
+ }
+
+ ~WStringEditor() {;}
+
+ /**
+ * Retrieves the type of the property for the editor.
+ */
+ EditorPropertyType getEditorPropertyType() const
+ {
+ return( WStringType );
+ }
+ };
 }}
 
 #endif // include guard
\ No newline at end of file

Deleted: sandbox/pinhole/boost/pinhole/action_info.h
==============================================================================
--- sandbox/pinhole/boost/pinhole/action_info.h 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
+++ (empty file)
@@ -1,59 +0,0 @@
-// MscProperty system action_info.h file
-//
-// Copyright Jared McIntyre 2007.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_DETAILS_ACTION_INFO
-#define BOOST_DETAILS_ACTION_INFO
-
-#if defined(BOOST_MSVC)
- #pragma warning(push)
- #pragma warning( disable: 4272 4394 )
-#endif
-#include "Editor.h"
-#if defined(BOOST_MSVC)
- #pragma warning(pop)
-#endif
-
-#if defined(BOOST_MSVC)
- #pragma warning(push)
- #pragma warning( disable: 4561 4793 )
-#endif
-#include <boost/type_traits.hpp>
-#include <boost/function.hpp>
-#include <boost/lexical_cast.hpp>
-#if defined(BOOST_MSVC)
- #pragma warning(pop)
-#endif
-
-namespace boost { namespace pinhole { namespace detail
-{
- struct action_info
- {
- private:
- template<typename type> struct Internal;
-
- public:
- typedef boost::function<void ()> action_type;
-
- virtual ~action_info(){;}
-
- action_type m_action;
- std::string m_name;
- std::string m_description;
-
- /**
- * Calls the appropriate action function for this parameter.
- *
- * @throw boost::bad_function_call There isn't a set function associated with this property.
- */
- virtual void trigger()
- {
- m_action();
- }
- };
-}}}
-
-#endif // include guard
\ No newline at end of file

Copied: sandbox/pinhole/boost/pinhole/action_info.hpp (from r41666, /sandbox/pinhole/boost/pinhole/action_info.h)
==============================================================================
--- /sandbox/pinhole/boost/pinhole/action_info.h (original)
+++ sandbox/pinhole/boost/pinhole/action_info.hpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
@@ -12,7 +12,7 @@
     #pragma warning(push)
     #pragma warning( disable: 4272 4394 )
 #endif
-#include "Editor.h"
+#include "Editor.hpp"
 #if defined(BOOST_MSVC)
     #pragma warning(pop)
 #endif

Deleted: sandbox/pinhole/boost/pinhole/exceptions.h
==============================================================================
--- sandbox/pinhole/boost/pinhole/exceptions.h 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
+++ (empty file)
@@ -1,36 +0,0 @@
-// MscProperty system Exceptions.h file
-//
-// Copyright Jared McIntyre 2007.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_DETAIL_EXCEPTIONS
-#define BOOST_DETAIL_EXCEPTIONS
-
-#include <exception>
-#include <stdexcept>
-#include <string>
-
-namespace boost { namespace pinhole
-{
- class multiple_property_groups : public std::runtime_error
- {
- public: multiple_property_groups(const std::string& strErrMsg) : std::runtime_error(strErrMsg) {;}
- };
-
- class invalid_path : public std::runtime_error
- {
- public: invalid_path(const std::string& strErrMsg) : std::runtime_error(strErrMsg) {;}
- };
-
- class failed_to_find_group : public std::exception{};
-
- class no_metadata_defined_error : public std::runtime_error
- {
- public:
- no_metadata_defined_error() : runtime_error( "No Property Editor Defined" ) {;}
- };
-}}
-
-#endif // include guard
\ No newline at end of file

Deleted: sandbox/pinhole/boost/pinhole/find.h
==============================================================================
--- sandbox/pinhole/boost/pinhole/find.h 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
+++ (empty file)
@@ -1,207 +0,0 @@
-// MscProperty system Find.h file
-//
-// Copyright Jared McIntyre 2007.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_FIND
-#define BOOST_FIND
-
-#include "property_manager.h"
-
-namespace boost { namespace pinhole
-{
- namespace detail
- {
- property_group* search_single_property_group_based_on_name( children_collection* current_property_group_collection,
- const string& property_group_name)
- {
- property_group* property_group_found = 0;
- for( children_collection::iterator iter = current_property_group_collection->begin(); iter != current_property_group_collection->end(); iter++)
- {
- property_group* current_property_group = *iter;
- if(current_property_group->get_name() == property_group_name)
- {
- if(property_group_found != 0)
- {
- string strError = "Multiple " + property_group_name + " are found in property_manager::selectSingleNode";
- throw multiple_property_groups(strError.c_str());
- }
- property_group_found = current_property_group;
- }
- }
- if(property_group_found == 0)
- {
- throw no_metadata_defined_error();
- }
- return property_group_found;
- }
-
- property_group* search_single_property_group_based_on_property_value( children_collection* current_property_group_collection,
- const string& property_group_name,
- const string& property_name,
- const string& property_value )
- {
- property_group* property_group_found = 0;
- for(children_collection::iterator iter = current_property_group_collection->begin(); iter != current_property_group_collection->end(); iter++)
- {
- property_group* current_property_group = *iter;
- if((current_property_group->get_name() == property_group_name) && (current_property_group->get_as_string(property_name) == property_value))
- {
- if(property_group_found != 0)
- {
- string strError = "Multiple " + property_group_name + "." + property_name + "=" + property_value + " are found in property_manager::selectSingleNode";
- throw multiple_property_groups(strError.c_str());
- }
- property_group_found = current_property_group;
- }
- }
- if(property_group_found == 0)
- {
- throw no_metadata_defined_error();
- }
- return property_group_found;
- }
- }
-
- /**
- * Returns a property_group based on a path that describes where that property_group
- * exists within the property group hierarchy. This path can either be from the
- * root of the hierarchy, or relative to the property_group passed in to the function
- * @n
- * Path format one: /A/X.Y=Z @n
- * A represents a property group name. The assumption is that A is the only property
- * group in the current level. The path search will start from root
- * @n
- * Path format two: A/X.Y=Z @n
- * A represents a property group name. The assumption is that A is the only property
- * group in the current level. The path search will start from current_property_group
- * @n
- * Path format three: /A.B=C/X.Y=Z @n
- * A and X represent property group names. B and Y represent property names. C and Z
- * represent property values. The path search will start from root.
- * @n
- * Path format four: A.B=C/X.Y=Z @n
- * A and X represent property group names. B and Y represent property names. C and Z
- * represent property values. The path search will start from current_property_group.
- *
- * @param current_property_group The property_group to perform relative searches under.
- * @param path The path to search with.
- * @return The property_group that was found to match the path.
- * @retval NULL No property_group was found to match the path.
- * @throw invalid_path The path does not meet the requirements for a valid path.
- * @throw multiple_property_groups There were multiple property groups matching this path.
- */
- property_group* select_single_node(property_group* current_property_group, const string& path)
- {
- children_collection* current_property_group_collection = NULL;
- if( NULL != current_property_group )
- {
- current_property_group_collection = &current_property_group->get_children_collection();
- }
- children_collection* root_property_group_collection = 0; //The root collection might not be needed if it is not referred.
-
- typedef vector< string > split_vector_type;
- split_vector_type vecproperty_groups;
- boost::split( vecproperty_groups, path, boost::is_any_of("/") ); //Note: "/" is the separator for a property group
- try
- {
- for(split_vector_type::const_iterator iter_property_group = vecproperty_groups.begin(); iter_property_group != vecproperty_groups.end(); iter_property_group++)
- {
- string strproperty_group = *iter_property_group;
- split_vector_type properties;
- boost::split( properties, strproperty_group, boost::is_any_of(".=") );
- //Note: "." is the separator between Property group name and Property name.
- //"=" is the separator between property name and property value. If there's no "." or "=",
- //we will just use this property group.
- size_t nNumOfItems = properties.size();
- switch(nNumOfItems)
- {
- case 1:
- {
- string strItem = properties[0]; //It either is "/" or the property group name.
- boost::trim(strItem);
- if(strItem.empty()) //It is "/"
- {
- property_manager *manager = property_manager::instance();
- root_property_group_collection = new children_collection();
- property_manager::iterator iter = manager->begin();
- property_manager::iterator iterEnd = manager->end();
- for( ; iter != iterEnd; iter++)
- {
- root_property_group_collection->push_back(*iter);
- }
- current_property_group_collection = root_property_group_collection; //From now on, we only care about current_property_group_collection.
- }
- else
- {
- //strItem here must be a property group name.
- //If multiple or none is found ,exception will be thrown.
- current_property_group = detail::search_single_property_group_based_on_name(current_property_group_collection, strItem);
- current_property_group_collection = &current_property_group->get_children_collection();
- }
- }
- break;
- case 3:
- {
- string property_group_name = properties[0];
- boost::trim(property_group_name);
-
- string property_name = properties[1];
- boost::trim(property_name);
-
- string property_value = properties[2];
- boost::trim(property_value);
- current_property_group = detail::search_single_property_group_based_on_property_value(current_property_group_collection, property_group_name, property_name, property_value);
- current_property_group_collection = &current_property_group->get_children_collection();
- }
- break;
- default:
- {
- string strError = path + " is not a valid path. Details: " + strproperty_group + " should be either A.B=C or A format";
- throw invalid_path(strError.c_str());
- }
- }
- }
- }
- catch(no_metadata_defined_error&)
- {
- current_property_group = NULL;
- }
-
- delete root_property_group_collection;
- return current_property_group;
- }
-
- property_group* select_single_node(property_group& current_property_group, const string& path)
- {
- return select_single_node(&current_property_group, path);
- }
-
- /**
- * Returns a property_group based on a path that describes where that property_group
- * exists within the property group hierarchy. This version does not allow for relative
- * path accessing.
- * @n
- * Path format one: /A/X.Y=Z @n
- * A represents a property group name. The assumption is that A is the only property
- * group in the current level. The path search will start from root\
- * @n
- * Path format two: /A.B=C/X.Y=Z @n
- * A and X represent property group names. B and Y represent property names. C and Z
- * represent property values. The path search will start from root.
- *
- * @param path The path to search with.
- * @return The property_group that was found to match the path.
- * @retval NULL No property_group was found to match the path.
- * @throw invalid_path The path does not meet the requirements for a valid path.
- * @throw multiple_property_groups There were multiple property groups matching this path.
- */
- property_group* select_single_node(const string& path)
- {
- return select_single_node(NULL, path);
- }
-}}
-
-#endif // include guard
\ No newline at end of file

Copied: sandbox/pinhole/boost/pinhole/find.hpp (from r41666, /sandbox/pinhole/boost/pinhole/find.h)
==============================================================================
--- /sandbox/pinhole/boost/pinhole/find.h (original)
+++ sandbox/pinhole/boost/pinhole/find.hpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
@@ -8,7 +8,7 @@
 #ifndef BOOST_FIND
 #define BOOST_FIND
 
-#include "property_manager.h"
+#include "property_manager.hpp"
 
 namespace boost { namespace pinhole
 {

Modified: sandbox/pinhole/boost/pinhole/main.cpp
==============================================================================
--- sandbox/pinhole/boost/pinhole/main.cpp (original)
+++ sandbox/pinhole/boost/pinhole/main.cpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
@@ -7,9 +7,9 @@
 
 #include <iostream>
 
-#include "property_group.h"
-#include "property_manager.h"
-#include "find.h"
+#include "property_group.hpp"
+#include "property_manager.hpp"
+#include "find.hpp"
 
 using namespace std;
 using namespace boost;

Deleted: sandbox/pinhole/boost/pinhole/map_key_value_iterators.h
==============================================================================
--- sandbox/pinhole/boost/pinhole/map_key_value_iterators.h 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
+++ (empty file)
@@ -1,125 +0,0 @@
-// MscProperty system map_key_value_iterators.h file
-//
-// Copyright Jared McIntyre 2007.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_MAP_KEY_VALUE_ITERATORS
-#define BOOST_MAP_KEY_VALUE_ITERATORS
-
-#include <boost/config.hpp>
-#if defined(BOOST_MSVC)
- #pragma warning(push)
- #pragma warning(disable: 4561 4996)
-#endif
-#include <boost/iterator.hpp>
-#include <boost/iterator/iterator_adaptor.hpp>
-#include <boost/iterator/iterator_categories.hpp>
-#include <boost/utility/enable_if.hpp>
-#include <boost/type_traits/is_pointer.hpp>
-#include <boost/static_assert.hpp>
-#if defined(BOOST_MSVC)
- #pragma warning(pop)
-#endif
-
-namespace boost { namespace pinhole
-{
- /** Iterates over all the keys in a map. */
- template <class Iterator>
- class map_key_iterator
- : public boost::iterator_adaptor<
- map_key_iterator<Iterator>
- , Iterator
- , boost::use_default
- , boost::use_default
- , typename std::iterator_traits<Iterator>::value_type::first_type
- >
- {
- private:
- typedef typename std::iterator_traits<Iterator>::value_type::first_type Reference;
-
- struct enabler {}; // a private type avoids misuse
-
- friend class boost::iterator_core_access;
-
- public:
- map_key_iterator() :
- map_key_iterator::iterator_adaptor_() { }
-
- explicit map_key_iterator( Iterator x, Iterator end = Iterator()) :
- map_key_iterator::iterator_adaptor_(x) { }
-
- template <class other_iterator>
- map_key_iterator(
- map_key_iterator<other_iterator> const& other
- , typename boost::enable_if<
- boost::is_convertible<other_iterator*, Iterator*>
- , enabler
- >::type = enabler()
- )
- : map_key_iterator::iterator_adaptor_(other.base()) {}
-
- Reference dereference() const
- {
- return (*this->base()).first;
- }
- };
-
- /** Factory for creating map_key_iterator iterators. */
- template <class Iterator>
- map_key_iterator<Iterator> make_map_key_iterator(Iterator x, Iterator end = Iterator())
- {
- return map_key_iterator<Iterator>(x,end);
- }
-
- /** Iterates over all values in a map. */
- template <class Iterator>
- class map_value_iterator
- : public boost::iterator_adaptor<
- map_value_iterator<Iterator>
- , Iterator
- , boost::use_default
- , boost::use_default
- , typename std::iterator_traits<Iterator>::value_type::second_type
- >
- {
- private:
- typedef typename std::iterator_traits<Iterator>::value_type::second_type Reference;
-
- struct enabler {}; // a private type avoids misuse
-
- friend class boost::iterator_core_access;
-
- public:
- map_value_iterator() :
- map_value_iterator::iterator_adaptor_() { }
-
- map_value_iterator( Iterator x, Iterator end = Iterator()) :
- map_value_iterator::iterator_adaptor_(x) { }
-
- template <class other_iterator>
- map_value_iterator(
- map_value_iterator<other_iterator> const& other
- , typename boost::enable_if<
- boost::is_convertible<other_iterator*, Iterator*>
- , enabler
- >::type = enabler()
- )
- : map_value_iterator::iterator_adaptor_(other.base()) {}
-
- Reference dereference() const
- {
- return (*this->base()).second;
- }
- };
-
- /** Factory for creating map_value_iterator iterators. */
- template <class Iterator>
- map_value_iterator<Iterator> make_map_value_iterator(Iterator x, Iterator end = Iterator())
- {
- return map_value_iterator<Iterator>(x,end);
- }
-}}
-
-#endif // include guard
\ No newline at end of file

Deleted: sandbox/pinhole/boost/pinhole/property_group.h
==============================================================================
--- sandbox/pinhole/boost/pinhole/property_group.h 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
+++ (empty file)
@@ -1,779 +0,0 @@
-// MscProperty system property_group.h file
-//
-// Copyright Jared McIntyre 2007.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_PROPERTY_GROUP
-#define BOOST_PROPERTY_GROUP
-
-#include "map_key_value_iterators.h"
-#include "EditorTypeFinder.h"
-#include "property_info.h"
-#include "action_info.h"
-#include "property_manager.h"
-#include <set>
-#include <list>
-#include <sstream>
-
-#if defined(BOOST_MSVC)
- #pragma warning(push)
- #pragma warning( disable: 4561)
-#endif
-#include <boost/bind.hpp>
-#include <boost/static_assert.hpp>
-#include <boost/type_traits.hpp>
-#include <boost/function.hpp>
-#include <boost/any.hpp>
-#if defined(BOOST_MSVC)
- #pragma warning(pop)
-#endif
-
-#define BOOST_SETTER(c) boost::bind(c, this, _1)
-#if defined(BOOST_MSVC) && (_MSC_VER > 1310) && (_MSC_VER <= 1400)
- #define BOOST_GETTER(c) boost::bind(boost::mem_fn(c), this)
-#else
- #define BOOST_GETTER(c) boost::bind(c, this)
-#endif
-#define BOOST_ACTION(c) boost::bind(c, this)
-
-namespace boost { namespace pinhole
-{
- template<typename T>
- struct property_system_var_setter
- {
- typedef T result_type;
-
- property_system_var_setter(T &t) : var(t){}
-
- void operator()(const T &value)
- {
- var = value;
- }
-
- T &var;
- };
-
- template<typename T>
- inline boost::function<void (const T&)> property_system_var_setter_builder(T &t)
- {
- return boost::bind<void>(property_system_var_setter<T>(t), _1);
- }
-
- #define BOOST_SETTER_VAR(c) property_system_var_setter_builder(c)
-
- template<typename T>
- struct property_system_var_getter
- {
- typedef T result_type;
-
- property_system_var_getter(T &t) : var(t){}
-
- T operator()()
- {
- return var;
- }
-
- T &var;
- };
-
- template<typename T>
- inline boost::function<T ()> property_system_var_getter_builder(T &t)
- {
- return boost::bind<T>(property_system_var_getter<T>(t));
- }
-
- #define BOOST_GETTER_VAR(c) boost::pinhole::property_system_var_getter_builder(c)
-
- struct no_setter_struct {};
- struct no_getter_struct {};
-
- #define BOOST_SETTER_NONE boost::pinhole::no_setter_struct()
- #define BOOST_GETTER_NONE boost::pinhole::no_getter_struct()
-
- class property_group;
-
- typedef std::set<std::string> category_collection;
- typedef std::list<property_group*> children_collection;
- typedef std::map<std::string, detail::property_info_base*> property_collection;
- typedef std::map<std::string, detail::action_info*> action_collection;
-
- /**
- * Manages a list of properties for an object. A property is defined by a
- * string that is unique to the object and a set of getter and setter
- * functions that set and retrieve values.
- */
- class property_group
- {
- public:
- /**
- * Constructor.
- * @param name The name of this property group
- * @param parent The parent of the this object or NULL if it is a root group.
- */
- property_group( std::string name, property_group *parent=NULL ) :
- m_name( name ),
- m_parent( parent )
- {
- setup_parent_and_category_and_manager();
- }
-
- explicit property_group( const property_group& old_property_group )
- {
- m_name = old_property_group.m_name;
- m_parent = old_property_group.m_parent;
-
- setup_parent_and_category_and_manager();
- }
-
- /** Destructor. */
- virtual ~property_group()
- {
- // Calling OnParentDeleting will likely modify m_children_collection,
- // so we can't use it directly.
- children_collection temp_child(m_children_collection);
- children_collection::iterator childIter = temp_child.begin();
- children_collection::iterator childIterEnd = temp_child.end();
- for( ; childIter != childIterEnd; ++childIter )
- {
- (*childIter)->set_parent(NULL);
- }
- temp_child.clear();
-
- if ( NULL != m_parent )
- {
- m_parent->remove_child(this);
- }
-
- if ( property_manager::instance() != NULL )
- {
- // Unregister this group with this property manager...
- property_manager::instance()->unregister_property_group( this, m_category_collection );
- }
-
- // cleanup all the property_manager classes
- property_collection::iterator propItr = m_properties.begin();
- property_collection::iterator propItrEnd = m_properties.end();
- for( ; propItr != propItrEnd; ++propItr )
- {
- delete (*propItr).second;
- (*propItr).second = NULL;
- }
- m_properties.clear();
-
- // cleanup all the action classes
- action_collection::iterator actionItr = m_actions.begin();
- action_collection::iterator actionItrEnd = m_actions.end();
- for( ; actionItr != actionItrEnd; ++actionItr )
- {
- delete (*actionItr).second;
- (*actionItr).second = NULL;
- }
- m_actions.clear();
- }
-
-
- /**
- * Gets the parent of this property group.
- * @return The parent of this property group.
- */
- property_group* get_parent() const
- {
- return( m_parent );
- }
-
- /**
- * Sets the parent of this property group.
- * @param new_parent The new parent of this property group.
- */
- void set_parent(property_group* new_parent)
- {
- if( NULL != property_manager::instance() )
- {
- // Register this group with this property manager...
- property_manager::instance()->unregister_property_group(this, m_category_collection);
- }
-
- if ( NULL != m_parent )
- {
- m_parent->remove_child(this);
- }
-
- m_parent = new_parent;
-
-
- if ( NULL != m_parent )
- {
- m_parent->add_child(this);
- }
-
- if( NULL != property_manager::instance() )
- {
- // Register this group with this property manager...
- property_manager::instance()->register_property_group(this);
- }
- }
-
- /**
- * Gets the name of this property group.
- * @return The name of this property group.
- */
- const std::string get_name() const
- {
- return( m_name );
- }
-
- /**
- * Gets the category collection of this property group.
- * @return The category collection of this property group.
- * @todo Remove this accessor
- */
- const category_collection& get_category_collection()
- {
- return( m_category_collection );
- }
-
- /**
- * Gets the property group children collection of this property group.
- * @return The property group children collection of this property group.
- * @todo Remove this accessor
- */
- children_collection& get_children_collection()
- {
- return( m_children_collection );
- }
-
- /** @name Properties */
- //@{
- typedef property_collection::size_type prop_size_type;
- typedef map_key_iterator<property_collection::iterator> prop_iterator;
- typedef map_key_iterator<property_collection::const_iterator> const_prop_iterator;
-
- /**
- * Retrieves an iterator pointing to the name of the first property.
- */
- prop_iterator prop_begin()
- {
- return prop_iterator( m_properties.begin() );
- }
-
- /**
- * Retrieves an iterator pointing to the name of the first property.
- */
- const_prop_iterator prop_begin() const
- {
- return const_prop_iterator( m_properties.begin() );
- }
-
- /**
- * Retrieves an iterator pointing to the end of the property list.
- */
- prop_iterator prop_end()
- {
- return prop_iterator( m_properties.end() );
- }
-
- /**
- * Retrieves an iterator pointing to the end of the property list.
- */
- const_prop_iterator prop_end() const
- {
- return const_prop_iterator( m_properties.end() );
- }
-
- /**
- * Retrieves the number of properties.
- */
- prop_size_type prop_count() const
- {
- return m_properties.size();
- }
-
- /**
- * Gets a property's value by it's type.
- * @param property The name of the property.
- * @return The value of the property.
- * @throw boost::bad_function_call There isn't a get_as_string function associated with this property.
- * @throw std::out_of_range The property requested does not exist.
- * @throw std::bad_cast The requested return_type was not the same as the property's type.
- */
- template<typename Return_Type>
- Return_Type get(const std::string &property) const
- {
- // The system does not allow you to use pointers as property
- // types due to the ambiguity of their use.
- BOOST_STATIC_ASSERT(false == boost::is_pointer<Return_Type>::value);
-
- property_collection::const_iterator itemItr = m_properties.find(property);
-
- if( m_properties.end() != itemItr )
- {
- detail::property_info_base* propInfo = (*itemItr).second;
-
- // throws boost::bad_function_call if there isn't a get_as_string
- // function associated with this property.
- if( NULL != propInfo && typeid(Return_Type) == propInfo->m_type )
- {
- return static_cast<detail::property_info<Return_Type>*>(propInfo)->getter();
- }
-
- throw std::bad_cast();
- }
-
- stringstream err;
- err << "The requested property \"" << property << "\" does not exist.";
- throw std::out_of_range(err.str().c_str());
- }
-
- /**
- * Sets a property's value.
- * @param property The name of the property.
- * @param value The value to set on the property.
- * @throw boost::bad_function_call There isn't a set_as_string function associated with this property.
- * @throw std::out_of_range The property requested does not exist.
- * @throw std::bad_cast The Set_Type was not the same as the property's type.
- */
- template<typename Set_Type>
- void set(const std::string &property, Set_Type value) const
- {
- // The system does not allow you to use pointers as property
- // types due to the ambiguity of their use.
- BOOST_STATIC_ASSERT(false == boost::is_pointer<Set_Type>::value);
-
- property_collection::const_iterator itemItr = m_properties.find(property);
-
- if( m_properties.end() != itemItr )
- {
- detail::property_info_base* propInfo = (*itemItr).second;
-
- // throws boost::bad_function_call if there isn't a get_as_string
- // function associated with this property.
- if( NULL != propInfo && typeid(Set_Type) == propInfo->m_type )
- {
- return static_cast<detail::property_info<Set_Type>*>(propInfo)->setter(value);
- }
-
- throw std::bad_cast();
- }
-
- stringstream err;
- err << "The requested property \"" << property << "\" does not exist.";
- throw std::out_of_range(err.str().c_str());
- }
-
- /**
- * Sets a property's value.
- * @param property The name of the property.
- * @param value A String representation of the value to set on the property.
- * @throw boost::bad_function_call There isn't a set_as_string function associated with this property.
- * @throw std::out_of_range The property requested does not exist.
- * @throw std::invalid_argument The value string could not be converted to the
- * type expected by the internal setter function.
- */
- void set_as_string(const std::string &property, const std::string &value)
- {
- property_collection::iterator itemItr = m_properties.find(property);
-
- if( m_properties.end() != itemItr )
- {
- // throws boost::bad_function_call if there isn't a set_as_string
- // function associated with this property.
- (*itemItr).second->set_as_string(value);
- }
- else
- {
- stringstream err;
- err << "The requested property \"" << property << "\" does not exist.";
- throw std::out_of_range(err.str().c_str());
- }
- }
-
- /**
- * Gets a property's value.
- * @param property The name of the property.
- * @return A String representation of the value of the property.
- * @throw boost::bad_function_call There isn't a get_as_string function associated with this property.
- * @throw std::out_of_range The property requested does not exist.
- */
- std::string get_as_string(const std::string &property) const
- {
- property_collection::const_iterator itemItr = m_properties.find(property);
-
- if( m_properties.end() != itemItr )
- {
- // throws boost::bad_function_call if there isn't a get_as_string
- // function associated with this property.
- return (*itemItr).second->get_as_string();
- }
-
- stringstream err;
- err << "The requested property \"" << property << "\" does not exist.";
- throw std::out_of_range(err.str().c_str());
- }
-
- /**
- * Gets a property's Editor object.
- * @param property The name of the property.
- * @return The Editor of the property.
- * @throw no_metadata_defined_error There isn't a property editor associated with this property.
- * @throw std::out_of_range The property requested does not exist.
- */
- const Editor* get_metadata(const std::string &property) const
- {
- property_collection::const_iterator itemItr = m_properties.find(property);
-
- if( itemItr != m_properties.end() )
- {
- // throws boost::bad_function_call if there isn't a get
- // function associated with this property.
- if ( (*itemItr).second->m_editor == NULL )
- {
- throw( no_metadata_defined_error() );
- }
- else
- {
- return( (*itemItr).second->m_editor );
- }
- }
- else
- {
- stringstream err;
- err << "The requested property \"" << property << "\" does not exist.";
- throw std::out_of_range(err.str().c_str());
- }
- }
-
- /**
- * Gets a property's type_info structure.
- * @param property The name of the property.
- * @return The type_info structure of the property.
- * @throw std::out_of_range The property requested does not exist.
- */
- const type_info& get_type_info(const std::string &property) const
- {
- property_collection::const_iterator itemItr = m_properties.find(property);
-
- if( itemItr != m_properties.end() )
- {
- return (*itemItr).second->m_type;
- }
- else
- {
- stringstream err;
- err << "The requested property \"" << property << "\" does not exist.";
- throw std::out_of_range(err.str().c_str());
- }
- }
-
- /**
- * Retrieves whether the property is read only or not.
- * @param property The name of the property.
- * @retval true The property is read only.
- * @retval false The property is writeable.
- * @throw std::out_of_range The property requested does not exist.
- */
- bool is_read_only(const std::string &property) const
- {
- property_collection::const_iterator itemItr = m_properties.find(property);
-
- if( itemItr != m_properties.end() )
- {
- return (*itemItr).second->is_read_only();
- }
- else
- {
- stringstream err;
- err << "The requested property \"" << property << "\" does not exist.";
- throw std::out_of_range(err.str().c_str());
- }
- }
- //@}
-
- /** @name Actions */
- //@{
- typedef action_collection::size_type action_size_type;
- typedef map_key_iterator<action_collection::iterator> action_iterator;
- typedef map_key_iterator<action_collection::const_iterator> const_action_iterator;
-
- /**
- * Retrieves an iterator pointing to the name of the first property.
- */
- action_iterator action_begin()
- {
- return action_iterator( m_actions.begin() );
- }
-
- /**
- * Retrieves an iterator pointing to the name of the first property.
- */
- const_action_iterator action_begin() const
- {
- return const_action_iterator( m_actions.begin() );
- }
-
- /**
- * Retrieves an iterator pointing to the end of the property list.
- */
- action_iterator action_end()
- {
- return action_iterator( m_actions.end() );
- }
-
- /**
- * Retrieves an iterator pointing to the end of the property list.
- */
- const_action_iterator action_end() const
- {
- return const_action_iterator( m_actions.end() );
- }
-
- /**
- * Retrieves the number of properties.
- */
- action_size_type action_count() const
- {
- return m_actions.size();
- }
-
- /**
- * Triggers an action.
- * @param action The name of the action.
- * @throw std::out_of_range The property requested does not exist.
- */
- void trigger(const std::string &action) const
- {
- action_collection::const_iterator itemItr = m_actions.find(action);
-
- if( m_actions.end() != itemItr )
- {
- // throws boost::bad_function_call if there isn't a set
- // function associated with this property.
- (*itemItr).second->trigger();
- }
- else
- {
- stringstream err;
- err << "The requested action \"" << action << "\" does not exist.";
- throw std::out_of_range(err.str().c_str());
- }
- }
-
- //@}
-
- protected:
-
- /**
- * Adds a property to the property list.
- * @param name The name of the property.
- * @param description A brief description of the property for the user interface.
- * @param setter The function used to set the property.
- * @param getter The function used to get the property.
- */
- template<typename Setter, typename Getter>
- void add_property( std::string name,
- std::string description,
- Setter setter,
- Getter getter)
- {
- internal_add_property< typename Getter::result_type >( name, description, setter, getter);
- }
-
- /**
- * Adds a property to the property list.
- * @param name The name of the property.
- * @param description A brief description of the property for the user interface.
- * @param setter The function used to set the property.
- * @param getter The function used to get the property.
- */
- template<typename Getter>
- void add_property( std::string name,
- std::string description,
- no_setter_struct setter,
- Getter getter)
- {
- internal_add_property< typename Getter::result_type >( name, description, NULL, getter);
- }
-
- /**
- * Adds a property to the property list.
- * @param name The name of the property.
- * @param description A brief description of the property for the user interface.
- * @param setter The function used to set the property.
- * @param getter The function used to get the property.
- */
- template<typename Setter, typename Getter>
- void add_property( std::string name,
- std::string description,
- Setter setter,
- no_getter_struct getter)
- {
- internal_add_property< typename Setter::argument_type >( name, description, setter, NULL);
- }
-
- /**
- * Adds a property to the property list.
- * @param name The name of the property.
- * @param description A brief description of the property for the user interface.
- * @param setter The function used to set the property.
- * @param getter The function used to get the property.
- * @param pEditor A pointer to the editor to be used with this property, or null
- * if there isn't one.
- */
- template< typename Setter, typename Getter>
- void add_property( string name,
- string description,
- Setter setter,
- Getter getter,
- Editor *pEditor )
- {
- internal_add_property< typename Getter::result_type >( name, description, setter, getter, pEditor);
- }
-
- /**
- * Adds a property to the property list.
- * @param name The name of the property.
- * @param description A brief description of the property for the user interface.
- * @param setter The function used to set the property.
- * @param getter The function used to get the property.
- * @param pEditor A pointer to the editor to be used with this property, or null
- * if there isn't one.
- */
- template< typename Getter>
- void add_property( string name,
- string description,
- no_setter_struct,
- Getter getter,
- Editor *pEditor )
- {
- internal_add_property< typename Getter::result_type >( name, description, NULL, getter, pEditor);
- }
-
- /**
- * Adds an action to the action list.
- * @param The name of the action.
- * @param description A brief description of the action for the user interface.
- * @param action The function used to trigger the action.
- */
- void add_action( std::string name,
- std::string description,
- boost::function<void ()> action )
- {
- detail::action_info *action_info = new detail::action_info();
-
- action_info->m_name = name;
- action_info->m_description = description;
- action_info->m_action = action;
-
- m_actions.insert( std::make_pair(name, action_info) );
- }
-
- /**
- * Adds this property to the specified category.
- * @param category_name The name of the category to add.
- */
- void add_category( const std::string &category_name )
- {
- m_category_collection.insert( category_name );
-
- // notify the Property Manager of this new category
- if ( property_manager::instance() != NULL )
- {
- property_manager::instance()->add_category( category_name, this );
- }
- }
-
- #if defined(BOOST_MSVC)
- #pragma warning(push)
- #pragma warning( disable: 4251 )
- #endif
- category_collection m_category_collection;
- children_collection m_children_collection;
- property_collection m_properties;
- action_collection m_actions;
- #if defined(BOOST_MSVC)
- #pragma warning(pop)
- #endif
-
- private:
- property_group();
-
- template<typename Value_Type>
- void internal_add_property( const std::string &name,
- const std::string &description,
- boost::function<void (const Value_Type&)> setter,
- boost::function<Value_Type ()> getter )
- {
- typedef typename detail::EditorTypeFinder<Value_Type>::type editor_type;
-
- // You are using a Value_Type that does not have a default editor defined. Use once
- // of the add_property functions where you explicitly define the editor or editor type.
- BOOST_STATIC_ASSERT((false == boost::is_same<editor_type, boost::mpl::void_>::value));
-
- internal_add_property<Value_Type>( name, description, setter, getter, new editor_type() );
- }
-
- template<typename Value_Type>
- void internal_add_property( const std::string &name,
- const std::string &description,
- boost::function<void (const Value_Type&)> setter,
- boost::function<Value_Type ()> getter,
- Editor *pEditor )
- {
- // If you get an error here, then the type you are using for the property likely doesn't have a proper operator<< for it
- detail::property_info<Value_Type> *prop = new detail::property_info<Value_Type>();
-
- prop->m_name = name;
- prop->m_description = description;
- if( NULL != setter )
- {
- prop->setter = setter;
- }
- if( NULL != getter )
- {
- prop->getter = getter;
- }
- prop->m_editor = pEditor;
-
- m_properties.insert( std::make_pair(name, prop) );
- }
-
- void add_child(property_group* pChild)
- {
- if( NULL != pChild )
- {
- m_children_collection.push_back( pChild );
- }
- }
-
- void remove_child(property_group* pChild)
- {
- if( NULL != pChild )
- {
- m_children_collection.remove(pChild);
- }
- }
-
- void setup_parent_and_category_and_manager()
- {
- if ( NULL != m_parent )
- {
- m_parent->add_child(this);
- }
-
- add_category( "All" );
-
- if ( property_manager::instance() != NULL )
- {
- // Register this group with this property manager...
- property_manager::instance()->register_property_group( this );
- }
- }
-
- std::string m_name;
- property_group *m_parent;
- };
-
-}}
-
-#endif // include guard
\ No newline at end of file

Copied: sandbox/pinhole/boost/pinhole/property_group.hpp (from r41666, /sandbox/pinhole/boost/pinhole/property_group.h)
==============================================================================
--- /sandbox/pinhole/boost/pinhole/property_group.h (original)
+++ sandbox/pinhole/boost/pinhole/property_group.hpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
@@ -8,11 +8,11 @@
 #ifndef BOOST_PROPERTY_GROUP
 #define BOOST_PROPERTY_GROUP
 
-#include "map_key_value_iterators.h"
-#include "EditorTypeFinder.h"
-#include "property_info.h"
-#include "action_info.h"
-#include "property_manager.h"
+#include "map_key_value_iterators.hpp"
+#include "EditorTypeFinder.hpp"
+#include "property_info.hpp"
+#include "action_info.hpp"
+#include "property_manager.hpp"
 #include <set>
 #include <list>
 #include <sstream>
@@ -61,7 +61,7 @@
         return boost::bind<void>(property_system_var_setter<T>(t), _1);
     }
 
- #define BOOST_SETTER_VAR(c) property_system_var_setter_builder(c)
+ #define BOOST_SETTER_VAR(c) boost::pinhole::property_system_var_setter_builder(c)
 
     template<typename T>
     struct property_system_var_getter
@@ -560,8 +560,6 @@
             }
 
         //@}
-
- protected:
         
         /**
          * Adds a property to the property list.
@@ -683,6 +681,8 @@
             }
         }
 
+ protected:
+
         #if defined(BOOST_MSVC)
             #pragma warning(push)
             #pragma warning( disable: 4251 )

Deleted: sandbox/pinhole/boost/pinhole/property_group_wrapper.h
==============================================================================
--- sandbox/pinhole/boost/pinhole/property_group_wrapper.h 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
+++ (empty file)
@@ -1,100 +0,0 @@
-// MscProperty system property_group_wrapper.h file
-//
-// Copyright Jared McIntyre 2007.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_PROPERTY_GROUP_WRAPPER
-#define BOOST_PROPERTY_GROUP_WRAPPER
-
-#include "property_group.h"
-
-namespace boost { namespace pinhole
-{
- /**
- * The property_group_wrapper allows you to create property groups without inheriting directly
- * from property_group. This allows you to do things like create groups of properties for
- * display in the UI that don't have a matching logical object in the system.
- */
- class property_group_wrapper : public property_group
- {
- public:
- /**
- * Constructor.
- * @param name The name of this property group (like an xml node name)
- * @param parent The parent of the this object.
- */
- property_group_wrapper(std::string name, property_group *parent)
- : property_group(name, parent){;}
-
- ~property_group_wrapper(void){;}
-
- /**
- * Adds a property to the property list.
- * @param The name of the property.
- * @param description A brief description of the property for the user interface.
- * @param setter The function used to set the property.
- * @param getter The function used to get the property.
- */
- template<typename Setter, typename Getter>
- void add_property( std::string name,
- std::string description,
- Setter setter,
- Getter getter )
- {
- property_group::add_property( name, description, setter, getter );
- }
-
- /**
- * Adds a property to the property list.
- * @param The name of the property.
- * @param description A brief description of the property for the user interface.
- * @param setter The function used to set the property.
- * @param getter The function used to get the property.
- * @param pEditor A pointer to the editor to be used with this property, or null
- * if there isn't one.
- */
- template<typename Setter, typename Getter>
- void add_property( std::string name,
- std::string description,
- Setter setter,
- Getter getter,
- Editor *pEditor )
- {
-
- property_group::add_property( name, description, setter, getter, pEditor );
- }
-
- /**
- * Adds an action to the action list.
- * @param The name of the action.
- * @param description A brief description of the action for the user interface.
- * @param action The function used to trigger the action.
- */
- inline void add_action( std::string name,
- std::string description,
- boost::function<void ()> action )
- {
-
- property_group::add_action( name, description, action );
- }
-
- /**
- * Gets an xml string representation of this property group
- * @param string The name of the new category.
- * @return The xml string representation of this property group.
- */
- inline void add_category( const std::string &category_name )
- {
- property_group::add_category( category_name );
- }
-
- private:
- property_group_wrapper() : property_group("", NULL) {;}
- property_group_wrapper(const property_group& object) : property_group(object) {;}
- property_group_wrapper(const property_group_wrapper& object) : property_group(object) {;}
- };
-}}
-
-#endif // include guard
\ No newline at end of file

Copied: sandbox/pinhole/boost/pinhole/property_group_wrapper.hpp (from r41666, /sandbox/pinhole/boost/pinhole/property_group_wrapper.h)
==============================================================================
--- /sandbox/pinhole/boost/pinhole/property_group_wrapper.h (original)
+++ sandbox/pinhole/boost/pinhole/property_group_wrapper.hpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
@@ -8,7 +8,7 @@
 #ifndef BOOST_PROPERTY_GROUP_WRAPPER
 #define BOOST_PROPERTY_GROUP_WRAPPER
 
-#include "property_group.h"
+#include "property_group.hpp"
 
 namespace boost { namespace pinhole
 {

Deleted: sandbox/pinhole/boost/pinhole/property_info.h
==============================================================================
--- sandbox/pinhole/boost/pinhole/property_info.h 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
+++ (empty file)
@@ -1,244 +0,0 @@
-// MscProperty system property_manager.h file
-//
-// Copyright Jared McIntyre 2007.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_PROPERTY_INFO
-#define BOOST_PROPERTY_INFO
-
-#if defined(BOOST_MSVC)
- #pragma warning(push)
- #pragma warning( disable: 4272 4394 )
-#endif
-#include "Editor.h"
-#if defined(BOOST_MSVC)
- #pragma warning(pop)
-#endif
-
-#if defined(BOOST_MSVC)
- #pragma warning(push)
- #pragma warning( disable: 4561 4793 )
-#endif
-#include <boost/type_traits.hpp>
-#include <boost/function.hpp>
-#include <boost/lexical_cast.hpp>
-#if defined(BOOST_MSVC)
- #pragma warning(pop)
-#endif
-
-namespace boost { namespace pinhole { namespace detail
-{
- #define BOOL_TRUE ("True")
- #define BOOL_FALSE ("False")
-
- ///////////////////////////////////////////////////
- // set_as_string Override Functors
- ///////////////////////////////////////////////////
-
- /**
- * The default setter processor. This uses lexical cast
- * to convert the passed in set string to any type that
- * has proper stream operators.
- */
- template<typename Value_Type>
- struct internal_string_set
- {
- template<typename Set_Type>
- inline void operator()( Set_Type setter, std::string value )
- {
- try
- {
- setter( boost::lexical_cast<Value_Type>(value) );
- }
- catch(boost::bad_lexical_cast &)
- {
- std::stringstream err;
- err << "The value '" << value << "' is not valid for this property.";
- throw std::invalid_argument(err.str().c_str());
- }
- }
- };
-
- /**
- * Setter for handling string types. Since a string was passed in, and
- * the type in the setter function is a string, we don't need to do any
- * conversion.
- */
- template<>
- struct internal_string_set<std::string>
- {
- template<typename Set_Type>
- inline void operator()( Set_Type setter, std::string value )
- {
- setter( value );
- }
- };
-
-
- /**
- * Setter for handling bool types. Since a bool was passed in,
- * we need to convert
- */
- template<>
- struct internal_string_set<bool>
- {
- template<typename Set_Type>
- inline void operator()( Set_Type setter, std::string value )
- {
- setter( value == BOOL_TRUE );
- }
- };
-
- ///////////////////////////////////////////////////
- // get_as_string Override Functors
- ///////////////////////////////////////////////////
-
- /**
- * The default getter processor. This uses lexical cast
- * to convert the returned value from the propertied
- * getter function and convert to a string using
- * lexical_cast. Any type that has proper stream operators
- * should work.
- */
-
- template<typename Value_Type>
- struct internal_string_get
- {
- template<typename Get_Type>
- inline std::string operator()( Get_Type getter ) const
- {
- return boost::lexical_cast<string>( getter() );
- }
- };
-
- /**
- * Getter for handling string types. Since a string returned,
- * and getter returns a string type, we don't need to do any
- * conversion.
- */
- template<>
- struct internal_string_get<std::string>
- {
- template<typename Get_Type>
- inline std::string operator()( Get_Type getter ) const
- {
- return getter();
- }
- };
-
- /**
- * Getter for handling bool types. Since a string is returned,
- * we need to convert the bool to a string.
- */
- template<>
- struct internal_string_get<bool>
- {
- template<typename Get_Type>
- inline std::string operator()( Get_Type getter ) const
- {
- return( getter() ? "True" : "False" );
- }
- };
-
- struct property_info_base
- {
- public:
- property_info_base(const type_info &type) :
- m_editor( NULL ),
- m_type(type)
- {;}
-
- virtual ~property_info_base()
- {
- if ( m_editor != NULL )
- delete( m_editor );
- }
-
- std::string m_name;
- std::string m_description;
- Editor *m_editor;
- const type_info &m_type;
-
- virtual void set_as_string(std::string value) = 0;
- virtual std::string get_as_string() const = 0;
- virtual bool is_read_only() const = 0;
- };
-
- template<typename T>
- struct property_info : property_info_base
- {
- private:
-
- public:
- typedef typename boost::remove_reference<T>::type Value_Type;
- typedef boost::function<void (const Value_Type&)> setter_type;
- typedef boost::function<Value_Type ()> getter_type;
-
- // The system does not allow you to use pointers as property
- // types due to the ambiguity of their use.
- BOOST_STATIC_ASSERT(false == boost::is_pointer<Value_Type>::value);
-
- setter_type setter;
- getter_type getter;
-
- property_info() : property_info_base(typeid(T)) {;}
-
- /**
- * Calls the appropriate getter function for this parameter and converts
- * the value to a string for return.
- *
- * @return A String representation of the value of the property.
- * @throw boost::bad_function_call There isn't a get_as_string function associated with this property.
- */
- virtual std::string get_as_string() const
- {
- // If you get an error here, and it complains about:
- // error C2679: binary '<<' : no operator found which takes a right-hand operand of type
- // then the type you are using for the property doesn't have a proper operator<< for it
- //
- // throws boost::bad_function_call if there isn't a get_as_string function associated with this property.
- return internal_string_get<Value_Type>()(getter);
- }
-
- /**
- * Calls the appropriate setter function for this parameter and converts
- * the passed in string to whatever type the setter is expect. For example,
- * if the properties setter is expecting an int, the string will be
- * converted to an int before being passed to the function.
- * <br><br>
- * We call an internal setter in a struct so that we can override
- * what the set does based on the type of Value_Type. For example,
- * we wanted to write a special handler for the string type for
- * performance, so we overrode the string handler in "struct Internal<string>"
- * to just pass the string along instead of convert it. The beauty of doing it
- * this way is that there is no runtime cost. All functions are inlined,
- * and the additional function calls and type processing are optimized out
- * at compile time.
- *
- * @param value A String representation of the value to set on the property.
- * @throw boost::bad_function_call There isn't a set_as_string function associated with this property.
- * @throw std::invalid_argument The value string could not be converted to the
- * type expected by the internal setter function.
- */
- virtual void set_as_string(std::string value)
- {
- // see the function documentation for more information about this.
- //
- // throws boost::bad_function_call if there isn't a set_as_string function associated with this property.
- internal_string_set<Value_Type>()(setter, value);
- }
-
- /**
- * Checks if this is a read-only property (ie, cant set)
- * @return true if the property is read-only.
- */
- virtual bool is_read_only() const
- {
- return( !setter );
- }
- };
-}}}
-
-#endif // include guard
\ No newline at end of file

Copied: sandbox/pinhole/boost/pinhole/property_info.hpp (from r41666, /sandbox/pinhole/boost/pinhole/property_info.h)
==============================================================================
--- /sandbox/pinhole/boost/pinhole/property_info.h (original)
+++ sandbox/pinhole/boost/pinhole/property_info.hpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
@@ -12,7 +12,7 @@
     #pragma warning(push)
     #pragma warning( disable: 4272 4394 )
 #endif
-#include "Editor.h"
+#include "Editor.hpp"
 #if defined(BOOST_MSVC)
     #pragma warning(pop)
 #endif
@@ -24,14 +24,15 @@
 #include <boost/type_traits.hpp>
 #include <boost/function.hpp>
 #include <boost/lexical_cast.hpp>
+#include <boost/algorithm/string/compare.hpp>
 #if defined(BOOST_MSVC)
     #pragma warning(pop)
 #endif
 
 namespace boost { namespace pinhole { namespace detail
 {
- #define BOOL_TRUE ("True")
- #define BOOL_FALSE ("False")
+ #define BOOL_TRUE "True"
+ #define BOOL_FALSE "False"
 
     ///////////////////////////////////////////////////
     // set_as_string Override Functors
@@ -87,7 +88,7 @@
         template<typename Set_Type>
         inline void operator()( Set_Type setter, std::string value )
         {
- setter( value == BOOL_TRUE );
+ setter( boost::iequals(value, BOOL_TRUE) || value == "1" );
         }
     };
 

Deleted: sandbox/pinhole/boost/pinhole/property_manager.h
==============================================================================
--- sandbox/pinhole/boost/pinhole/property_manager.h 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
+++ (empty file)
@@ -1,284 +0,0 @@
-// MscProperty system property_manager.h file
-//
-// Copyright Jared McIntyre 2007.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_PROPERTY_MANAGER
-#define BOOST_PROPERTY_MANAGER
-
-#include "exceptions.h"
-#include "map_key_value_iterators.h"
-#include <set>
-#include <string>
-
-#include <boost/config.hpp>
-#if defined(BOOST_MSVC)
- #pragma warning(push)
- #pragma warning( disable: 4561 4793 )
-#endif
-#include <boost/shared_ptr.hpp>
-#include <boost/signals.hpp>
-#include <boost/algorithm/string.hpp>
-#if defined(BOOST_MSVC)
- #pragma warning(pop)
-#endif
-
-namespace boost { namespace pinhole
-{
- class property_group;
-
- typedef std::set<std::string> category_collection;
- typedef std::list<property_group*> children_collection;
-
- class event_source
- {
- public :
- static event_source* instance()
- {
- if ( m_instance == 0 ) // is it the first call?
- {
- m_instance = new event_source; // create sole instance
- }
-
- return m_instance; // address of sole instance
- }
-
- #if defined(BOOST_MSVC)
- #pragma warning(push)
- #pragma warning( disable: 4251 )
- #endif
- boost::signal<void(property_group*)> add_event;
- boost::signal<void(property_group*)> remove_event;
- #if defined(BOOST_MSVC)
- #pragma warning(pop)
- #endif
- void raise_on_add_event( property_group *group )
- {
- add_event( group );
- }
-
- void raise_on_remove_event( property_group *group )
- {
- remove_event( group );
- }
-
- private :
- static event_source *m_instance;
- event_source(){};
-
- };
-
- class property_manager
- {
- private:
- static void deleter(property_manager* manager)
- {
- delete manager;
- }
-
- public:
- typedef std::multimap<std::string, property_group*> category_to_property_group_map;
- typedef map_value_iterator<category_to_property_group_map::iterator> iterator;
- typedef map_value_iterator<category_to_property_group_map::const_iterator> const_iterator;
-
- static property_manager* instance()
- {
- if ( m_instance.get() == NULL ) // is it the first call?
- {
- m_instance.reset( new property_manager, property_manager::deleter ); // create sole instance
- }
-
- return m_instance.get(); // address of sole instance
- }
-
- static bool exists()
- {
- return m_instance.get() != NULL;
- }
-
- static void delete_instance()
- {
- if( m_instance.get() != NULL )
- {
- m_instance.reset();
- }
- }
-
- protected:
- property_manager(){;}
-
- // TODO: This needs to be protected so no-one will deal with it, but
- // checked_delete can't be made a friend in gcc, so I can't shared_ptr
- // to work.
- public:
- virtual ~property_manager()
- {
- category_to_property_group_map::iterator itr = m_property_group_collection.begin();
- category_to_property_group_map::iterator itr_end = m_property_group_collection.end();
- for( ; itr != itr_end; ++itr )
- {
- event_source::instance()->raise_on_remove_event((*itr).second);
- }
- }
-
- public:
- /**
- * Retrieves an iterator pointing to the first property group.
- */
- iterator begin()
- {
- return iterator( m_property_group_collection.lower_bound("All"),
- m_property_group_collection.upper_bound("All") );
- }
-
- /**
- * Retrieves an iterator pointing to the first property group.
- */
- const_iterator begin() const
- {
- return const_iterator( m_property_group_collection.lower_bound("All"),
- m_property_group_collection.upper_bound("All") );
- }
-
- /**
- * Retrieves an iterator pointing to the end of the root property list.
- */
- iterator end()
- {
- return iterator( m_property_group_collection.upper_bound("All") );
- }
-
- /**
- * Retrieves an iterator pointing to the end of the root property list.
- */
- const_iterator end() const
- {
- return const_iterator( m_property_group_collection.upper_bound("All") );
- }
-
- /**
- * Retrieves the number of property groups.
- */
- size_t count() const
- {
- return m_property_group_collection.count("All");
- }
-
- /**
- * Retrieves an iterator pointing to the first property group for a specified category.
- */
- iterator begin(const std::string& strCategory)
- {
- return iterator( m_property_group_collection.lower_bound(strCategory) );
- }
-
- /**
- * Retrieves an iterator pointing to the first property group for a specified category.
- */
- const_iterator begin(const std::string& strCategory) const
- {
- return const_iterator( m_property_group_collection.lower_bound(strCategory) );
- }
-
- /**
- * Retrieves an iterator pointing to the end of the root property list for a specified category.
- */
- iterator end(const std::string& strCategory)
- {
- return iterator( m_property_group_collection.upper_bound(strCategory) );
- }
-
- /**
- * Retrieves an iterator pointing to the end of the root property list for a specified category.
- */
- const_iterator end(const std::string& strCategory) const
- {
- return const_iterator( m_property_group_collection.upper_bound(strCategory) );
- }
-
- /**
- * Retrieves the number of property groups for a specified category.
- */
- size_t count(const std::string& strCategory) const
- {
- return m_property_group_collection.count(strCategory);
- }
-
- /**
- * Gets the master category list.
- * @return master category list.
- */
- const category_collection* get_category_collection()
- {
- return( &m_category_collection );
- }
-
- protected:
- /**
- * Register's group with the property_manager.
- */
- virtual void register_property_group( property_group *group )
- {
- event_source::instance()->raise_on_add_event( group );
- }
-
- /**
- * Unregister's group from the property_manager.
- */
- virtual void unregister_property_group( property_group *group, category_collection &categories )
- {
- category_collection::const_iterator categoryItr = categories.begin();
- category_collection::const_iterator categoryEnd = categories.end();
- for ( ; categoryItr != categoryEnd; ++categoryItr )
- {
- remove_category( *categoryItr, group );
- }
-
- event_source::instance()->raise_on_remove_event( group );
- }
-
- /**
- * Adds a new category for the property group.
- */
- virtual void add_category( const std::string &category_name, property_group *group )
- {
- m_category_collection.insert( category_name );
- m_property_group_collection.insert( make_pair( category_name, group ) );
- }
-
- virtual void remove_category( const std::string &category_name, property_group *group )
- {
- category_to_property_group_map::iterator pgItr;
- for ( pgItr = m_property_group_collection.find( category_name );
- pgItr != m_property_group_collection.end(); )
- {
- if ( pgItr->second == group )
- {
- m_property_group_collection.erase( pgItr++ );
- }
- else
- {
- pgItr++;
- }
- }
- }
-
- protected:
- #if defined(BOOST_MSVC)
- #pragma warning(push)
- #pragma warning( disable: 4251 )
- #endif
- static boost::shared_ptr<property_manager> m_instance;
- category_to_property_group_map m_property_group_collection;
- category_collection m_category_collection;
- #if defined(BOOST_MSVC)
- #pragma warning(pop)
- #endif
-
- friend class property_group;
- };
-}}
-
-#endif // include guard
\ No newline at end of file

Copied: sandbox/pinhole/boost/pinhole/property_manager.hpp (from r41666, /sandbox/pinhole/boost/pinhole/property_manager.h)
==============================================================================
--- /sandbox/pinhole/boost/pinhole/property_manager.h (original)
+++ sandbox/pinhole/boost/pinhole/property_manager.hpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
@@ -8,8 +8,8 @@
 #ifndef BOOST_PROPERTY_MANAGER
 #define BOOST_PROPERTY_MANAGER
 
-#include "exceptions.h"
-#include "map_key_value_iterators.h"
+#include "exceptions.hpp"
+#include "map_key_value_iterators.hpp"
 #include <set>
 #include <string>
 

Modified: sandbox/pinhole/libs/pinhole/test/Jamfile.v2
==============================================================================
--- sandbox/pinhole/libs/pinhole/test/Jamfile.v2 (original)
+++ sandbox/pinhole/libs/pinhole/test/Jamfile.v2 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
@@ -20,16 +20,16 @@
 {
   test-suite pinhole
     :
- [ run TestPropertyGroups.cpp ]
- [ run TestPropertyGroupWrapper.cpp ]
+ [ run test_property_groups.cpp ]
+ #[ run test_property_group_wrapper.cpp ]
   
- [ run TestBoolProperties.cpp ]
- [ run TestDoubleProperties.cpp ]
- [ run TestFloatProperties.cpp ]
- [ run TestIntegerProperties.cpp ]
- [ run TestStringProperties.cpp ]
+ [ run test_bool_properties.cpp ]
+ [ run test_double_properties.cpp ]
+ [ run test_float_properties.cpp ]
+ [ run test_integer_properties.cpp ]
+ [ run test_string_properties.cpp ]
   
- [ run TestActions.cpp ]
+ [ run test_actions.cpp ]
   
   #[ run TestSerializer.cpp ]
  ;

Deleted: sandbox/pinhole/libs/pinhole/test/TestActions.cpp
==============================================================================
--- sandbox/pinhole/libs/pinhole/test/TestActions.cpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
+++ (empty file)
@@ -1,51 +0,0 @@
-// Boost.Pinhole library
-
-// Copyright Jared McIntyre 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#define BOOST_TEST_MODULE PinholeLib
-#include <boost/test/unit_test.hpp>
-#include "TestClassesAndConstants.h"
-
-// I can hide these two line if I don't do everything in headers
-boost::shared_ptr<property_manager> property_manager::m_instance(new property_manager);
-event_source* event_source::m_instance = 0;
-
-BOOST_AUTO_TEST_CASE( TestTriggerAction )
-{
- TestActionsFixture testFixture;
-
- BOOST_CHECK_EQUAL(testFixture.bTriggeredAction1, false);
- testFixture.trigger(ACTION_1);
- BOOST_CHECK_EQUAL(testFixture.bTriggeredAction1, true);
-
- BOOST_CHECK_EQUAL(testFixture.bTriggeredAction2, false);
- testFixture.trigger(ACTION_2);
- BOOST_CHECK_EQUAL(testFixture.bTriggeredAction2, true);
-}
-
-BOOST_AUTO_TEST_CASE( TestNonExistentAction )
-{
- TestActionsFixture testFixture;
-
- BOOST_CHECK_THROW( testFixture.trigger("NonExistent Action"), std::out_of_range );
-}
-
-BOOST_AUTO_TEST_CASE( TestGetActionCollection )
-{
- TestActionsFixture testFixture;
-
- property_group::action_iterator itr = testFixture.action_begin();
- property_group::action_iterator itrEnd = testFixture.action_end();
-
- BOOST_CHECK_EQUAL( testFixture.action_count(), 2u );
- BOOST_CHECK_EQUAL( *itr, ACTION_1 );
- ++itr;
- BOOST_CHECK_EQUAL( *itr, ACTION_2 );
- ++itr;
- BOOST_CHECK( itr == itrEnd );
-}
\ No newline at end of file

Deleted: sandbox/pinhole/libs/pinhole/test/TestBoolProperties.cpp
==============================================================================
--- sandbox/pinhole/libs/pinhole/test/TestBoolProperties.cpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
+++ (empty file)
@@ -1,82 +0,0 @@
-// Boost.Pinhole library
-
-// Copyright Jared McIntyre 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#define BOOST_TEST_MODULE PinholeLib
-#include <boost/test/unit_test.hpp>
-#include "TestClassesAndConstants.h"
-
-// I can hide these two line if I don't do everything in headers
-boost::shared_ptr<property_manager> property_manager::m_instance(new property_manager);
-event_source* event_source::m_instance = 0;
-
-BOOST_AUTO_TEST_CASE( TestSetGetBool )
-{
- TestPropertyGroup testGroup;
-
- testGroup.set_as_string( PROPERTY_STRING_2, PROPERTY_STRING_2_VALUE );
- BOOST_CHECK( PROPERTY_STRING_2_VALUE == testGroup.get_as_string( PROPERTY_STRING_2) );
-}
-
-BOOST_AUTO_TEST_CASE( TestSetGetBoolVar )
-{
- TestPropertyGroup testGroup;
-
- testGroup.set_as_string( PROPERTY_BOOL_VAR, PROPERTY_BOOL_VALUE );
- BOOST_CHECK_EQUAL( testGroup.get_as_string( PROPERTY_BOOL_VAR), PROPERTY_BOOL_VALUE );
-}
-
-BOOST_AUTO_TEST_CASE( TestBoolPropertyType )
-{
- TestPropertyGroup_4 testGroup;
-
- BOOST_CHECK( typeid(bool) == testGroup.get_type_info(PROPERTY_BOOL) );
- BOOST_CHECK( typeid(int) != testGroup.get_type_info(PROPERTY_BOOL) );
- BOOST_CHECK( typeid(float) != testGroup.get_type_info(PROPERTY_BOOL) );
- BOOST_CHECK( typeid(double) != testGroup.get_type_info(PROPERTY_BOOL) );
- BOOST_CHECK( typeid(std::string) != testGroup.get_type_info(PROPERTY_BOOL) );
-
- const BoolEditor *pEditor = dynamic_cast<const BoolEditor*>(testGroup.get_metadata( PROPERTY_BOOL ));
- BOOST_CHECK( pEditor != NULL );
- BOOST_CHECK( testGroup.get_metadata(PROPERTY_BOOL)->getEditorPropertyType() == BooleanType );
-}
-
-BOOST_AUTO_TEST_CASE( TestBoolGetControlType )
-{
- TestPropertyGroup_4 testGroup;
-
- const BoolEditor *pEditor = dynamic_cast<const BoolEditor*>(testGroup.get_metadata( PROPERTY_BOOL ));
- BOOST_CHECK( pEditor->GetControlType() == Radio );
-}
-
-BOOST_AUTO_TEST_CASE( TestBoolGetSet )
-{
- TestPropertyGroup_4 testGroup;
-
- testGroup.set_as_string( PROPERTY_BOOL, BOOL_TRUE );
- BOOST_CHECK( testGroup.get_as_string( PROPERTY_BOOL ) == BOOL_TRUE );
-
- testGroup.set_as_string( PROPERTY_BOOL, BOOL_FALSE );
- BOOST_CHECK( testGroup.get_as_string( PROPERTY_BOOL ) == BOOL_FALSE );
-}
-
-BOOST_AUTO_TEST_CASE( TestInvalidSet )
-{
- TestPropertyGroup_4 testGroup;
-
- // TODO
- testGroup.set_as_string( PROPERTY_BOOL, "Foo" );
-}
-
-BOOST_AUTO_TEST_CASE( TestAutoGeneratedDesignerBool )
-{
- TestAutoGeneratedDesigners testGroup;
-
- const Editor* pEditor = testGroup.get_metadata(PROPERTY_BOOL);
- BOOST_CHECK( NULL != dynamic_cast<const BoolEditor*>(pEditor) );
-}

Deleted: sandbox/pinhole/libs/pinhole/test/TestClassesAndConstants.h
==============================================================================
--- sandbox/pinhole/libs/pinhole/test/TestClassesAndConstants.h 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
+++ (empty file)
@@ -1,548 +0,0 @@
-// Boost.Pinhole library
-
-// Copyright Jared McIntyre 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#include <boost/pinhole/property_group.h>
-#include <boost/pinhole/IntegerEditor.h>
-#include <boost/pinhole/FloatEditor.h>
-#include <boost/pinhole/StringEditor.h>
-#include <boost/pinhole/BoolEditor.h>
-#include <boost/pinhole/DoubleEditor.h>
-#include <boost/pinhole/property_manager.h>
-
-using namespace boost::pinhole;
-
-#define PROPERTY_GROUP_NAME ("TestPropertyGroup")
-#define PROPERTY_GROUP_CATEGORY1 ("MyPropertyGroupCategory1")
-#define PROPERTY_GROUP_CATEGORY2 ("MyPropertyGroupCategory2")
-#define PROPERTY_GROUP_CATEGORY3 ("MyPropertyGroupCategory3")
-#define PROPERTY_GROUP_CHILD_NAME ("TestPropertyChildGroup")
-
-#define PROPERTY_STRING_1 ("PropertyString1")
-#define PROPERTY_STRING_1_VALUE ("PropertyString1_Value")
-
-#define PROPERTY_FLOAT_1 ("PropertyFloat1")
-#define PROPERTY_FLOAT_1_VAR ("PropertyFloat1Var")
-#define PROPERTY_FLOAT_1_VALUE ( 3.14161f )
-#define PROPERTY_FLOAT_1_STRING_VALUE ( "3.14161" )
-
-#define PROPERTY_FLOAT_2 ("PropertyFloat2")
-#define PROPERTY_FLOAT_2_VALUE ( 345.123f )
-#define PROPERTY_FLOAT_2_STRING_VALUE ( "345.123" )
-
-#define PROPERTY_DOUBLE ("PropertyDouble")
-#define PROPERTY_DOUBLE_VAR ("PropertyDoubleVar")
-#define PROPERTY_DOUBLE_VALUE ( 54321.1234596432 )
-#define PROPERTY_DOUBLE_STRING_VALUE ( "54321.1234596432" )
-
-#define PROPERTY_DOUBLE_2 ("PropertyDouble2")
-#define PROPERTY_DOUBLE_2_VALUE ( 54321.1234596432 )
-#define PROPERTY_DOUBLE_2_STRING_VALUE ( "54321.1234596432" )
-
-#define PROPERTY_INT_1 ("PropertyInt1")
-#define PROPERTY_INT_1_VAR ("PropertyInt1Var")
-#define PROPERTY_INT_1_VALUE (54321)
-#define PROPERTY_INT_1_STRING_VALUE ("54321")
-#define PROPERTY_INT_2 ("PropertyInt2")
-#define PROPERTY_INT_2_VALUE (12345)
-
-#define PROPERTY_STRING_2 ("PropertyString2")
-#define PROPERTY_STRING_2_VAR ("PropertyString2Var")
-#define PROPERTY_STRING_2_VALUE ("PropertyString2_Value")
-
-#define PROPERTY_BOOL ("PropertyBool")
-#define PROPERTY_BOOL_VAR ("PropertyBoolVar")
-#define PROPERTY_BOOL_VALUE ("True")
-
-#define PROPERTY_NAME ("Name")
-
-#define ACTION_1 ("BOOST_ACTION 1")
-#define ACTION_2 ("BOOST_ACTION 2")
-
-const static string PropertyGroupXML(
-"<TestPropertyGroup>\
-<PropertyBool>True</PropertyBool>\
-<PropertyFloat1>3.14161</PropertyFloat1>\
-<PropertyInt1>54321</PropertyInt1>\
-<PropertyString1>PropertyString1_Value</PropertyString1>\
-<PropertyString2>PropertyString2_Value</PropertyString2>\
-<TestPropertyChildGroup>\
-<PropertyFloat1>3.14161</PropertyFloat1>\
-<PropertyInt1>54321</PropertyInt1>\
-<PropertyString2>PropertyString2_Value</PropertyString2>\
-</TestPropertyChildGroup>\
-<TestPropertyChildGroup>\
-<PropertyFloat1>3.14161</PropertyFloat1>\
-<PropertyInt1>54321</PropertyInt1>\
-<PropertyString2>PropertyString2_Value</PropertyString2>\
-</TestPropertyChildGroup>\
-</TestPropertyGroup>"
-);
-
-// helper function to convert from types to strings
-template <class T>
-bool from_string(T& t,
- const std::string& s,
- std::ios_base& (*f)(std::ios_base&))
-{
- std::istringstream iss(s);
- return !(iss >> f >> t).fail();
-}
-
-class TestPropertyChildGroup : public property_group
-{
-public:
- TestPropertyChildGroup( property_group *pParentGroup) : property_group( PROPERTY_GROUP_CHILD_NAME, pParentGroup )
- {
- add_property(PROPERTY_FLOAT_1, "PropertyFloat1 description", BOOST_SETTER(&TestPropertyChildGroup::SetFloat), BOOST_GETTER(&TestPropertyChildGroup::GetFloat), new FloatEditor());
- add_property(PROPERTY_INT_1, "PropertyInt1 description", BOOST_SETTER(&TestPropertyChildGroup::SetInt), BOOST_GETTER(&TestPropertyChildGroup::GetInt), new IntegerEditor());
- add_property(PROPERTY_STRING_2, "PropertyString2 description", BOOST_SETTER(&TestPropertyChildGroup::SetPropertyString2), BOOST_GETTER(&TestPropertyChildGroup::GetPropertyString2), new StringEditor());
- }
-
- float GetFloat() const{return( m_fFloat1 );}
- void SetFloat( float fValue ){m_fFloat1 = fValue;}
- int GetInt() const{return( m_iInt1 );}
- void SetInt( int iValue ){m_iInt1 = iValue;}
- string GetPropertyString2(){return( m_strString2 );}
- void SetPropertyString2( string strValue ){m_strString2 = strValue;}
-
- float m_fFloat1;
- int m_iInt1;
- string m_strString2;
-};
-
-class TestPropertyGroup : public property_group
-{
-public:
-#if defined(BOOST_MSVC)
- #pragma warning(push)
- #pragma warning( disable: 4355 )
-#endif
- TestPropertyGroup() : property_group( PROPERTY_GROUP_NAME, NULL ), m_child1( this ), m_child2( this )
- {
- m_bVarBool = false;
-
- add_property(PROPERTY_STRING_1, "PropertyString1 description", BOOST_SETTER_NONE, BOOST_GETTER(&TestPropertyGroup::GetPropertyString1), new StringEditor());
- add_property(PROPERTY_FLOAT_1, "PropertyFloat1 description", BOOST_SETTER(&TestPropertyGroup::SetFloat), BOOST_GETTER(&TestPropertyGroup::GetFloat), new FloatEditor());
- add_property(PROPERTY_INT_1, "PropertyInt1 description", BOOST_SETTER(&TestPropertyGroup::SetInt), BOOST_GETTER(&TestPropertyGroup::GetInt), new IntegerEditor());
- add_property(PROPERTY_STRING_2, "PropertyString2 description", BOOST_SETTER(&TestPropertyGroup::SetPropertyString2), BOOST_GETTER(&TestPropertyGroup::GetPropertyString2), new StringEditor());
- add_property(PROPERTY_BOOL, "PropertyBool description", BOOST_SETTER(&TestPropertyGroup::SetBool), BOOST_GETTER(&TestPropertyGroup::GetBool), new BoolEditor());
-
- add_property(PROPERTY_FLOAT_1_VAR, "PropertyFloatVar description", BOOST_SETTER_VAR(m_fVarFloat1), BOOST_GETTER_VAR(m_fVarFloat1), new FloatEditor());
- add_property(PROPERTY_INT_1_VAR, "PropertyIntVar description", BOOST_SETTER_VAR(m_iVarInt1), BOOST_GETTER_VAR(m_iVarInt1), new IntegerEditor());
- add_property(PROPERTY_STRING_2_VAR, "PropertyStringVar description", BOOST_SETTER_VAR(m_strVarString2), BOOST_GETTER_VAR(m_strVarString2), new StringEditor());
- add_property(PROPERTY_BOOL_VAR, "PropertyBoolVar description", BOOST_SETTER_VAR(m_bVarBool), BOOST_GETTER_VAR(m_bVarBool), new BoolEditor());
- }
-#if defined(BOOST_MSVC)
- #pragma warning(pop)
-#endif
-
- TestPropertyChildGroup m_child1;
- TestPropertyChildGroup m_child2;
-
- string GetPropertyString1(){return PROPERTY_STRING_1_VALUE;}
- float GetFloat() const{return( m_fFloat1 );}
- void SetFloat( float fValue ){m_fFloat1 = fValue;}
- int GetInt() const{return( m_iInt1 );}
- void SetInt( int iValue ){m_iInt1 = iValue;}
- string GetPropertyString2(){return( m_strString2 );}
- void SetPropertyString2( string strValue ){m_strString2 = strValue;}
- void SetBool( bool b ){ m_bBool = b; }
- bool GetBool(){ return( m_bBool ); }
-
-private:
- float m_fFloat1;
- int m_iInt1;
- string m_strString2;
- bool m_bBool;
-
- float m_fVarFloat1;
- int m_iVarInt1;
- string m_strVarString2;
- bool m_bVarBool;
-};
-
-class TestPropertyGroup_1 : public property_group
-{
-public:
- TestPropertyGroup_1() : property_group( PROPERTY_GROUP_NAME, NULL )
- {
- add_property(PROPERTY_FLOAT_1, "PropertyFloat1 description", BOOST_SETTER(&TestPropertyGroup_1::SetFloat), BOOST_GETTER(&TestPropertyGroup_1::GetFloat), new FloatEditor() );
- add_property(PROPERTY_INT_1, "PropertyInt1 description", BOOST_SETTER(&TestPropertyGroup_1::SetInt), BOOST_GETTER(&TestPropertyGroup_1::GetInt), new IntegerEditor());
- add_property(PROPERTY_STRING_2, "PropertyString2 description", BOOST_SETTER(&TestPropertyGroup_1::SetPropertyString2), BOOST_GETTER(&TestPropertyGroup_1::GetPropertyString2), new StringEditor() );
- }
-
-private:
- float GetFloat() const{return( m_fFloat1 );}
- void SetFloat( float fValue ){m_fFloat1 = fValue;}
- int GetInt() const{return( m_iInt1 );}
- void SetInt( int iValue ){m_iInt1 = iValue;}
- string GetPropertyString2(){return( m_strString2 );}
- void SetPropertyString2( string strValue ){m_strString2 = strValue;}
-
- float m_fFloat1;
- int m_iInt1;
- string m_strString2;
-};
-
-const static string PropertyGroupXML_1(
-"<TestPropertyGroup PropertyFloat1='3.14161' PropertyString2='PropertyString2_Value'>\
-<PropertyInt1>54321</PropertyInt1>\
-</TestPropertyGroup>" );
-
-class TestPropertyGroup_2 : public property_group
-{
-public:
- TestPropertyGroup_2() : property_group( PROPERTY_GROUP_NAME, NULL )
- {
- add_property(PROPERTY_FLOAT_1, "PropertyFloat1 description", BOOST_SETTER(&TestPropertyGroup_2::SetFloat), BOOST_GETTER(&TestPropertyGroup_2::GetFloat), new FloatEditor() );
- add_property(PROPERTY_INT_1, "PropertyInt1 description", BOOST_SETTER(&TestPropertyGroup_2::SetInt), BOOST_GETTER(&TestPropertyGroup_2::GetInt), new IntegerEditor() );
- add_property(PROPERTY_STRING_2, "PropertyString2 description", BOOST_SETTER(&TestPropertyGroup_2::SetPropertyString2), BOOST_GETTER(&TestPropertyGroup_2::GetPropertyString2), new StringEditor() );
- }
-
-private:
- float GetFloat() const{return( m_fFloat1 );}
- void SetFloat( float fValue ){m_fFloat1 = fValue;}
- int GetInt() const{return( m_iInt1 );}
- void SetInt( int iValue ){m_iInt1 = iValue;}
- string GetPropertyString2(){return( m_strString2 );}
- void SetPropertyString2( string strValue ){m_strString2 = strValue;}
-
- float m_fFloat1;
- int m_iInt1;
- string m_strString2;
-};
-
-const static string PropertyGroupXML_2(
-"<TestPropertyGroup PropertyFloat1='3.14161' PropertyInt1='54321' PropertyString2='PropertyString2_Value'></TestPropertyGroup>" );
-
-class TestPropertyChildGroup_1 : public property_group
-{
-public:
- TestPropertyChildGroup_1( property_group *pParentGroup) : property_group( PROPERTY_GROUP_CHILD_NAME, pParentGroup )
- {
- add_property(PROPERTY_FLOAT_1, "PropertyFloat1 description", BOOST_SETTER(&TestPropertyChildGroup_1::SetFloat), BOOST_GETTER(&TestPropertyChildGroup_1::GetFloat), new FloatEditor());
- add_property(PROPERTY_INT_1, "PropertyInt1 description", BOOST_SETTER(&TestPropertyChildGroup_1::SetInt), BOOST_GETTER(&TestPropertyChildGroup_1::GetInt), new IntegerEditor() );
- add_property(PROPERTY_STRING_2, "PropertyString2 description", BOOST_SETTER(&TestPropertyChildGroup_1::SetPropertyString2), BOOST_GETTER(&TestPropertyChildGroup_1::GetPropertyString2), new StringEditor());
- }
-
-private:
- float GetFloat() const{return( m_fFloat1 );}
- void SetFloat( float fValue ){m_fFloat1 = fValue;}
- int GetInt() const{return( m_iInt1 );}
- void SetInt( int iValue ){m_iInt1 = iValue;}
- string GetPropertyString2(){return( m_strString2 );}
- void SetPropertyString2( string strValue ){m_strString2 = strValue;}
-
- float m_fFloat1;
- int m_iInt1;
- string m_strString2;
-};
-
-class TestPropertyGroup_3 : public property_group
-{
-public:
-#if defined(BOOST_MSVC)
- #pragma warning(push)
- #pragma warning( disable: 4355 )
-#endif
- TestPropertyGroup_3() : property_group( PROPERTY_GROUP_NAME, NULL ), m_child1( this ), m_child2( this )
- {
- add_property(PROPERTY_FLOAT_1, "PropertyFloat1 description", BOOST_SETTER(&TestPropertyGroup_3::SetFloat), BOOST_GETTER(&TestPropertyGroup_3::GetFloat), new FloatEditor() );
- add_property(PROPERTY_INT_1, "PropertyInt1 description", BOOST_SETTER(&TestPropertyGroup_3::SetInt), BOOST_GETTER(&TestPropertyGroup_3::GetInt), new IntegerEditor());
- add_property(PROPERTY_STRING_2, "PropertyString2 description", BOOST_SETTER(&TestPropertyGroup_3::SetPropertyString2), BOOST_GETTER(&TestPropertyGroup_3::GetPropertyString2), new StringEditor());
- add_property(PROPERTY_BOOL, "PropertyBool description", BOOST_SETTER(&TestPropertyGroup_3::SetBool), BOOST_GETTER(&TestPropertyGroup_3::GetBool), new BoolEditor());
- }
-#if defined(BOOST_MSVC)
- #pragma warning(pop)
-#endif
-
- TestPropertyChildGroup_1 m_child1;
- TestPropertyChildGroup_1 m_child2;
-
-private:
- float GetFloat() const{return( m_fFloat1 );}
- void SetFloat( float fValue ){m_fFloat1 = fValue;}
- int GetInt() const{return( m_iInt1 );}
- void SetInt( int iValue ){m_iInt1 = iValue;}
- string GetPropertyString2(){return( m_strString2 );}
- void SetPropertyString2( string strValue ){m_strString2 = strValue;}
- void SetBool( bool b ){ m_bBool = b; }
- bool GetBool(){ return( m_bBool ); }
-
- float m_fFloat1;
- int m_iInt1;
- string m_strString2;
- bool m_bBool;
-};
-
-const static string PropertyGroupXML_3(
-"<TestPropertyGroup PropertyFloat1='3.14161'>\
-<PropertyBool>True</PropertyBool>\
-<PropertyInt1>54321</PropertyInt1>\
-<PropertyString2>PropertyString2_Value</PropertyString2>\
-<TestPropertyChildGroup PropertyInt1='54321'>\
-<PropertyFloat1>3.14161</PropertyFloat1>\
-<PropertyString2>PropertyString2_Value</PropertyString2>\
-</TestPropertyChildGroup>\
-<TestPropertyChildGroup PropertyInt1='54321'>\
-<PropertyFloat1>3.14161</PropertyFloat1>\
-<PropertyString2>PropertyString2_Value</PropertyString2>\
-</TestPropertyChildGroup>\
-</TestPropertyGroup>" );
-
-const int INT_LOW = 3;
-const int INT_HIGH = 25;
-const int INT_INCREMENT = 2;
-const float FLOAT_LOW = -10.6f;
-const float FLOAT_HIGH = 25.7f;
-const float FLOAT_INCREMENT = 1.5f;
-const double DOUBLE_LOW = -3.7;
-const double DOUBLE_HIGH = 72.6;
-const double DOUBLE_INCREMENT = 0.5;
-class TestPropertyGroup_4 : public property_group
-{
-public:
-#if defined(BOOST_MSVC)
- #pragma warning(push)
- #pragma warning( disable: 4355 )
-#endif
- TestPropertyGroup_4() : property_group( PROPERTY_GROUP_NAME, NULL ), m_child1( this ), m_child2( this )
- {
- add_property(PROPERTY_FLOAT_1, "PropertyFloat1 description", BOOST_SETTER(&TestPropertyGroup_4::SetFloat), BOOST_GETTER(&TestPropertyGroup_4::GetFloat), new FloatEditor() );
- add_property(PROPERTY_FLOAT_2, "PropertyFloat2 description", BOOST_SETTER(&TestPropertyGroup_4::SetFloat2), BOOST_GETTER(&TestPropertyGroup_4::GetFloat2), new FloatEditor(FLOAT_LOW, FLOAT_HIGH, FLOAT_INCREMENT, Tracker ) );
- add_property(PROPERTY_INT_1, "PropertyInt1 description", BOOST_SETTER(&TestPropertyGroup_4::SetInt), BOOST_GETTER(&TestPropertyGroup_4::GetInt), new IntegerEditor(INT_LOW, INT_HIGH, INT_INCREMENT, DropDown));
- add_property(PROPERTY_INT_2, "PropertyInt2 description", BOOST_SETTER(&TestPropertyGroup_4::SetInt), BOOST_GETTER(&TestPropertyGroup_4::GetInt), new IntegerEditor());
- add_property(PROPERTY_STRING_2, "PropertyString2 description", BOOST_SETTER(&TestPropertyGroup_4::SetPropertyString2), BOOST_GETTER(&TestPropertyGroup_4::GetPropertyString2), new StringEditor());
- add_property(PROPERTY_BOOL, "PropertyBool description", BOOST_SETTER(&TestPropertyGroup_4::SetBool), BOOST_GETTER(&TestPropertyGroup_4::GetBool), new BoolEditor());
- }
-#if defined(BOOST_MSVC)
- #pragma warning(pop)
-#endif
-
- TestPropertyChildGroup_1 m_child1;
- TestPropertyChildGroup_1 m_child2;
- float GetFloat() const{return( m_fFloat1 );}
- void SetFloat( float fValue ){m_fFloat1 = fValue;}
- float GetFloat2() const{return( m_fFloat2 );}
- void SetFloat2( float fValue ){m_fFloat2 = fValue;}
- int GetInt() const{return( m_iInt1 );}
- void SetInt( int iValue ){m_iInt1 = iValue;}
- string GetPropertyString2(){return( m_strString2 );}
- void SetPropertyString2( string strValue ){m_strString2 = strValue;}
- void SetBool( bool b ){ m_bBool = b; }
- bool GetBool(){ return( m_bBool ); }
-
-private:
- float m_fFloat1;
- float m_fFloat2;
- int m_iInt1;
- string m_strString2;
- bool m_bBool;
-};
-
-const static string PropertyGroupXML_5(
-"<TestPropertyGroup>\
-<PropertyBool>True</PropertyBool>\
-<PropertyInt1>54321</PropertyInt1>\
-</TestPropertyGroup>" );
-
-class TestPropertyGroup_5 : public property_group
-{
-public:
- TestPropertyGroup_5() : property_group( PROPERTY_GROUP_NAME, NULL )
- {
- add_property(PROPERTY_FLOAT_1, "PropertyFloat1 description", BOOST_SETTER(&TestPropertyGroup_5::SetFloat), BOOST_GETTER(&TestPropertyGroup_5::GetFloat), new FloatEditor() );
- add_property(PROPERTY_INT_1, "PropertyInt1 description", BOOST_SETTER(&TestPropertyGroup_5::SetInt), BOOST_GETTER(&TestPropertyGroup_5::GetInt), NULL);
- add_property(PROPERTY_STRING_2, "PropertyString2 description", BOOST_SETTER(&TestPropertyGroup_5::SetPropertyString2), BOOST_GETTER(&TestPropertyGroup_5::GetPropertyString2), new StringEditor() );
- add_property(PROPERTY_BOOL, "PropertyBool description", BOOST_SETTER(&TestPropertyGroup_5::SetBool), BOOST_GETTER(&TestPropertyGroup_5::GetBool), new BoolEditor());
- add_property(PROPERTY_DOUBLE, "PropertyDouble description", BOOST_SETTER(&TestPropertyGroup_5::SetDouble), BOOST_GETTER(&TestPropertyGroup_5::GetDouble), new DoubleEditor() );
- add_property(PROPERTY_DOUBLE_2, "PropertyDouble2 description", BOOST_SETTER(&TestPropertyGroup_5::SetDouble2), BOOST_GETTER(&TestPropertyGroup_5::GetDouble2), new DoubleEditor(DOUBLE_LOW, DOUBLE_HIGH, DOUBLE_INCREMENT, Tracker) );
-
- add_property(PROPERTY_DOUBLE_VAR, "PropertyDoubleVar description", BOOST_SETTER_VAR(m_dVarDouble), BOOST_GETTER_VAR(m_dVarDouble), new BoolEditor());
- }
-
- void add_category( const std::string &category_name )
- {
- property_group::add_category( category_name );
- }
-
-
- template<typename Setter, typename Getter>
- void add_property( std::string name,
- std::string description,
- Setter setter,
- Getter getter )
- {
- property_group::add_property( name, description, setter, getter );
- }
-
- template<typename Setter, typename Getter>
- void add_property( std::string name,
- std::string description,
- Setter setter,
- Getter getter,
- Editor *pEditor )
- {
- property_group::add_property( name, description, setter, getter, pEditor );
- }
-
- void clear_properties()
- {
- m_properties.clear();
- }
-
- float GetFloat() const{return( m_fFloat1 );}
- void SetFloat( float fValue ){m_fFloat1 = fValue;}
- double GetDouble() const{return( m_dDouble );}
- void SetDouble( double dValue ){m_dDouble = dValue;}
- double GetDouble2() const{return( m_dDouble2 );}
- void SetDouble2( double dValue ){m_dDouble2 = dValue;}
- int GetInt() const{return( m_iInt1 );}
- void SetInt( int iValue ){m_iInt1 = iValue;}
- string GetPropertyString2(){return( m_strString2 );}
- void SetPropertyString2( string strValue ){m_strString2 = strValue;}
- void SetBool( bool b ){ m_bBool = b; }
- bool GetBool(){ return( m_bBool ); }
-
-private:
- float m_fFloat1;
- double m_dDouble;
- double m_dDouble2;
- int m_iInt1;
- string m_strString2;
- bool m_bBool;
-
- double m_dVarDouble;
-};
-
-class TestAutoGeneratedDesigners : public property_group
-{
-public:
-#if defined(BOOST_MSVC)
- #pragma warning(push)
- #pragma warning( disable: 4355 )
-#endif
- TestAutoGeneratedDesigners() : property_group( PROPERTY_GROUP_NAME, NULL )
- {
- add_property(PROPERTY_STRING_1, "PropertyString1 description", BOOST_SETTER_NONE, BOOST_GETTER(&TestAutoGeneratedDesigners::GetPropertyString1));
- add_property(PROPERTY_FLOAT_1, "PropertyFloat1 description", BOOST_SETTER(&TestAutoGeneratedDesigners::SetFloat), BOOST_GETTER(&TestAutoGeneratedDesigners::GetFloat));
- add_property(PROPERTY_INT_1, "PropertyInt1 description", BOOST_SETTER(&TestAutoGeneratedDesigners::SetInt), BOOST_GETTER(&TestAutoGeneratedDesigners::GetInt));
- add_property(PROPERTY_STRING_2, "PropertyString2 description", BOOST_SETTER(&TestAutoGeneratedDesigners::SetPropertyString2), BOOST_GETTER(&TestAutoGeneratedDesigners::GetPropertyString2));
- add_property(PROPERTY_BOOL, "PropertyBool description", BOOST_SETTER(&TestAutoGeneratedDesigners::SetBool), BOOST_GETTER(&TestAutoGeneratedDesigners::GetBool));
- add_property(PROPERTY_DOUBLE, "PropertyFloat1 description", BOOST_SETTER(&TestAutoGeneratedDesigners::SetDouble), BOOST_GETTER(&TestAutoGeneratedDesigners::GetDouble));
-
- }
-#if defined(BOOST_MSVC)
- #pragma warning(pop)
-#endif
-
-private:
- string GetPropertyString1(){return PROPERTY_STRING_1_VALUE;}
- float GetFloat() const{return( m_fFloat1 );}
- void SetFloat( float fValue ){m_fFloat1 = fValue;}
- int GetInt() const{return( m_iInt1 );}
- void SetInt( int iValue ){m_iInt1 = iValue;}
- string GetPropertyString2(){return( m_strString2 );}
- void SetPropertyString2( string strValue ){m_strString2 = strValue;}
- void SetBool( bool b ){ m_bBool = b; }
- bool GetBool(){ return( m_bBool ); }
- double GetDouble() const{return( m_dDouble );}
- void SetDouble( double dValue ){m_dDouble = dValue;}
-
- float m_fFloat1;
- int m_iInt1;
- string m_strString2;
- bool m_bBool;
- double m_dDouble;
-};
-
-class TestUpDownGroup : public property_group
-{
-public:
- TestUpDownGroup() : property_group( PROPERTY_GROUP_NAME, NULL )
- {
- add_property(PROPERTY_FLOAT_1, "PropertyFloat1 description", BOOST_SETTER(&TestUpDownGroup::SetFloat), BOOST_GETTER(&TestUpDownGroup::GetFloat), new FloatEditor(-1000,1000,1,UpDown) );
- }
-
-private:
- float GetFloat() const{return( m_fFloat1 );}
- void SetFloat( float fValue ){m_fFloat1 = fValue;}
- double GetDouble() const{return( m_dDouble );}
- void SetDouble( double dValue ){m_dDouble = dValue;}
- double GetDouble2() const{return( m_dDouble2 );}
- void SetDouble2( double dValue ){m_dDouble2 = dValue;}
- int GetInt() const{return( m_iInt1 );}
- void SetInt( int iValue ){m_iInt1 = iValue;}
-
-
- float m_fFloat1;
- double m_dDouble;
- double m_dDouble2;
- int m_iInt1;
-};
-
-class TestActionsFixture : public property_group
-{
-public:
-#if defined(BOOST_MSVC)
- #pragma warning(push)
- #pragma warning( disable: 4355 )
-#endif
- TestActionsFixture() : property_group( PROPERTY_GROUP_NAME, NULL )
- {
- bTriggeredAction1 = false;
- bTriggeredAction2 = false;
-
- add_action(ACTION_1, "First BOOST_ACTION", BOOST_ACTION(&TestActionsFixture::Action1));
- add_action(ACTION_2, "Second BOOST_ACTION", BOOST_ACTION(&TestActionsFixture::Action2));
- }
-#if defined(BOOST_MSVC)
- #pragma warning(pop)
-#endif
-
- void clear_actions()
- {
- m_actions.clear();
- }
-
- void Action1(){bTriggeredAction1 = true;}
- void Action2(){bTriggeredAction2 = true;}
-
- bool bTriggeredAction1;
- bool bTriggeredAction2;
-};
-
-class TestPropertySerializer : public property_group
-{
-public:
- TestPropertySerializer( property_group *pParentGroup) : property_group( "TestPropertySerializer", pParentGroup )
- {
- m_fFloat1 = 2.45f;
- m_iInt1 = 365;
- m_strString2 = "test value";
-
- add_property(PROPERTY_NAME, "Name", BOOST_SETTER_NONE, BOOST_GETTER(&TestPropertySerializer::GetName), new FloatEditor());
- add_property(PROPERTY_FLOAT_1, "PropertyFloat1 description", BOOST_SETTER(&TestPropertySerializer::SetFloat), BOOST_GETTER(&TestPropertySerializer::GetFloat), new FloatEditor());
- add_property(PROPERTY_INT_1, "PropertyInt1 description", BOOST_SETTER(&TestPropertySerializer::SetInt), BOOST_GETTER(&TestPropertySerializer::GetInt), new IntegerEditor() );
- add_property(PROPERTY_STRING_2, "PropertyString2 description", BOOST_SETTER(&TestPropertySerializer::SetPropertyString2), BOOST_GETTER(&TestPropertySerializer::GetPropertyString2), new StringEditor());
- }
-
-private:
- string GetName() const {return "aName";}
- float GetFloat() const{return( m_fFloat1 );}
- void SetFloat( float fValue ){m_fFloat1 = fValue;}
- int GetInt() const{return( m_iInt1 );}
- void SetInt( int iValue ){m_iInt1 = iValue;}
- string GetPropertyString2(){return( m_strString2 );}
- void SetPropertyString2( string strValue ){m_strString2 = strValue;}
-
- float m_fFloat1;
- int m_iInt1;
- string m_strString2;
-};
\ No newline at end of file

Copied: sandbox/pinhole/libs/pinhole/test/TestClassesAndConstants.hpp (from r41666, /sandbox/pinhole/libs/pinhole/test/TestClassesAndConstants.h)
==============================================================================
--- /sandbox/pinhole/libs/pinhole/test/TestClassesAndConstants.h (original)
+++ sandbox/pinhole/libs/pinhole/test/TestClassesAndConstants.hpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
@@ -7,13 +7,13 @@
 
 // For more information, see http://www.boost.org
 
-#include <boost/pinhole/property_group.h>
-#include <boost/pinhole/IntegerEditor.h>
-#include <boost/pinhole/FloatEditor.h>
-#include <boost/pinhole/StringEditor.h>
-#include <boost/pinhole/BoolEditor.h>
-#include <boost/pinhole/DoubleEditor.h>
-#include <boost/pinhole/property_manager.h>
+#include <boost/pinhole/property_group.hpp>
+#include <boost/pinhole/IntegerEditor.hpp>
+#include <boost/pinhole/FloatEditor.hpp>
+#include <boost/pinhole/StringEditor.hpp>
+#include <boost/pinhole/BoolEditor.hpp>
+#include <boost/pinhole/DoubleEditor.hpp>
+#include <boost/pinhole/property_manager.hpp>
 
 using namespace boost::pinhole;
 

Deleted: sandbox/pinhole/libs/pinhole/test/TestDoubleProperties.cpp
==============================================================================
--- sandbox/pinhole/libs/pinhole/test/TestDoubleProperties.cpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
+++ (empty file)
@@ -1,85 +0,0 @@
-// Boost.Pinhole library
-
-// Copyright Jared McIntyre 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#define BOOST_TEST_MODULE PinholeLib
-#include <boost/test/unit_test.hpp>
-#include "TestClassesAndConstants.h"
-
-// I can hide these two line if I don't do everything in headers
-boost::shared_ptr<property_manager> property_manager::m_instance(new property_manager);
-event_source* event_source::m_instance = 0;
-
-BOOST_AUTO_TEST_CASE( TestSetGetDouble )
-{
- TestPropertyGroup_5 testGroup;
-
- double dValue;
- testGroup.set_as_string( PROPERTY_DOUBLE, PROPERTY_DOUBLE_STRING_VALUE );
- BOOST_CHECK( from_string<double>(dValue, testGroup.get_as_string( PROPERTY_DOUBLE), std::dec) );
- BOOST_CHECK_EQUAL( dValue, PROPERTY_DOUBLE_VALUE );
-}
-
-BOOST_AUTO_TEST_CASE( TestSetGetDoubleVar )
-{
- TestPropertyGroup_5 testGroup;
-
- double dValue;
- testGroup.set_as_string( PROPERTY_DOUBLE_VAR, PROPERTY_DOUBLE_STRING_VALUE );
- BOOST_CHECK( from_string<double>(dValue, testGroup.get_as_string( PROPERTY_DOUBLE_VAR), std::dec) );
- BOOST_CHECK_EQUAL( dValue, PROPERTY_DOUBLE_VALUE );
-}
-
-BOOST_AUTO_TEST_CASE( TestDoublePropertyType )
-{
- TestPropertyGroup_5 testGroup;
-
- BOOST_CHECK( typeid(bool) != testGroup.get_type_info(PROPERTY_DOUBLE_2) );
- BOOST_CHECK( typeid(int) != testGroup.get_type_info(PROPERTY_DOUBLE_2) );
- BOOST_CHECK( typeid(float) != testGroup.get_type_info(PROPERTY_DOUBLE_2) );
- BOOST_CHECK( typeid(double) == testGroup.get_type_info(PROPERTY_DOUBLE_2) );
- BOOST_CHECK( typeid(std::string) != testGroup.get_type_info(PROPERTY_DOUBLE_2) );
-
- const DoubleEditor *pEditor = dynamic_cast<const DoubleEditor*>(testGroup.get_metadata( PROPERTY_DOUBLE_2 ));
- BOOST_CHECK( pEditor != NULL );
- BOOST_CHECK( testGroup.get_metadata(PROPERTY_DOUBLE_2)->getEditorPropertyType() == DoubleType );
-}
-
-BOOST_AUTO_TEST_CASE( TestDoubleGetUIOverrideType )
-{
- TestPropertyGroup_5 testGroup;
-
- const DoubleEditor *pEditor = dynamic_cast<const DoubleEditor*>(testGroup.get_metadata( PROPERTY_DOUBLE_2 ));
- BOOST_CHECK( pEditor->GetControlType() == Tracker );
-}
-
-BOOST_AUTO_TEST_CASE( TestDoubleHighLowIncrement )
-{
- TestPropertyGroup_5 testGroup;
-
- const DoubleEditor *pEditor = dynamic_cast<const DoubleEditor*>(testGroup.get_metadata( PROPERTY_DOUBLE_2 ));
- BOOST_CHECK( DOUBLE_LOW == pEditor->getLowRange() );
- BOOST_CHECK( DOUBLE_HIGH == pEditor->getHighRange() );
- BOOST_CHECK( DOUBLE_INCREMENT == pEditor->getIncrement() );
-}
-
-BOOST_AUTO_TEST_CASE( TestDouble2GetRange )
-{
- TestPropertyGroup_5 testGroup;
-
- const DoubleEditor *pEditor = dynamic_cast<const DoubleEditor*>(testGroup.get_metadata( PROPERTY_DOUBLE_2 ));
- BOOST_CHECK( pEditor->UseRange() == true );
-}
-
-BOOST_AUTO_TEST_CASE( TestAutoGeneratedDesignerDouble )
-{
- TestAutoGeneratedDesigners testGroup;
-
- const Editor* pEditor = testGroup.get_metadata(PROPERTY_DOUBLE);
- BOOST_CHECK( NULL != dynamic_cast<const DoubleEditor*>(pEditor) );
-}
\ No newline at end of file

Deleted: sandbox/pinhole/libs/pinhole/test/TestFloatProperties.cpp
==============================================================================
--- sandbox/pinhole/libs/pinhole/test/TestFloatProperties.cpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
+++ (empty file)
@@ -1,101 +0,0 @@
-// Boost.Pinhole library
-
-// Copyright Jared McIntyre 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#define BOOST_TEST_MODULE PinholeLib
-#include <boost/test/unit_test.hpp>
-#include "TestClassesAndConstants.h"
-
-// I can hide these two line if I don't do everything in headers
-boost::shared_ptr<property_manager> property_manager::m_instance(new property_manager);
-event_source* event_source::m_instance = 0;
-
-BOOST_AUTO_TEST_CASE( TestSetGetFloat )
-{
- TestPropertyGroup testGroup;
-
- float fValue;
- testGroup.set_as_string( PROPERTY_FLOAT_1, PROPERTY_FLOAT_1_STRING_VALUE );
- BOOST_CHECK( from_string<float>(fValue, testGroup.get_as_string(PROPERTY_FLOAT_1), std::dec) );
- BOOST_CHECK_EQUAL( PROPERTY_FLOAT_1_VALUE, fValue );
-}
-
-BOOST_AUTO_TEST_CASE( TestSetGetFloatVar )
-{
- TestPropertyGroup testGroup;
-
- float fValue;
- testGroup.set_as_string( PROPERTY_FLOAT_1_VAR, PROPERTY_FLOAT_1_STRING_VALUE );
- BOOST_CHECK( from_string<float>(fValue, testGroup.get_as_string(PROPERTY_FLOAT_1_VAR), std::dec) );
- BOOST_CHECK_EQUAL( PROPERTY_FLOAT_1_VALUE, fValue );
-}
-
-BOOST_AUTO_TEST_CASE( TestFloatPropertyType )
-{
- TestPropertyGroup_4 testGroup;
-
- BOOST_CHECK( typeid(bool) != testGroup.get_type_info(PROPERTY_FLOAT_1) );
- BOOST_CHECK( typeid(int) != testGroup.get_type_info(PROPERTY_FLOAT_1) );
- BOOST_CHECK( typeid(float) == testGroup.get_type_info(PROPERTY_FLOAT_1) );
- BOOST_CHECK( typeid(double) != testGroup.get_type_info(PROPERTY_FLOAT_1) );
- BOOST_CHECK( typeid(std::string) != testGroup.get_type_info(PROPERTY_FLOAT_1) );
-
- const FloatEditor *pEditor = dynamic_cast<const FloatEditor*>(testGroup.get_metadata( PROPERTY_FLOAT_1 ));
- BOOST_CHECK( pEditor != NULL );
- BOOST_CHECK( testGroup.get_metadata(PROPERTY_FLOAT_1)->getEditorPropertyType() == FloatType );
-}
-
-BOOST_AUTO_TEST_CASE( TestFloatGetControlType )
-{
- TestPropertyGroup_4 testGroup;
-
- const FloatEditor *pEditor = dynamic_cast<const FloatEditor*>(testGroup.get_metadata( PROPERTY_FLOAT_1 ));
- BOOST_CHECK( pEditor->GetControlType() == EditBox );
-}
-
-BOOST_AUTO_TEST_CASE( TestFloatGetUIOverrideType )
-{
- TestPropertyGroup_4 testGroup;
-
- const FloatEditor *pEditor = dynamic_cast<const FloatEditor*>(testGroup.get_metadata( PROPERTY_FLOAT_2 ));
- BOOST_CHECK( pEditor->GetControlType() == Tracker );
-}
-
-BOOST_AUTO_TEST_CASE( TestFloatHighLowIncrement )
-{
- TestPropertyGroup_4 testGroup;
-
- const FloatEditor *pEditor = dynamic_cast<const FloatEditor*>(testGroup.get_metadata( PROPERTY_FLOAT_2 ));
- BOOST_CHECK_EQUAL( FLOAT_LOW, pEditor->getLowRange() );
- BOOST_CHECK_EQUAL( FLOAT_HIGH, pEditor->getHighRange() );
- BOOST_CHECK_EQUAL( FLOAT_INCREMENT, pEditor->getIncrement() );
-}
-
-BOOST_AUTO_TEST_CASE( TestFloatGetRange )
-{
- TestPropertyGroup_4 testGroup;
-
- const FloatEditor *pEditor = dynamic_cast<const FloatEditor*>(testGroup.get_metadata( PROPERTY_FLOAT_2 ));
- BOOST_CHECK( pEditor->UseRange() == true );
-}
-
-BOOST_AUTO_TEST_CASE( TestAutoGeneratedDesignerFloat )
-{
- TestAutoGeneratedDesigners testGroup;
-
- const Editor* pEditor = testGroup.get_metadata(PROPERTY_FLOAT_1);
- BOOST_CHECK( NULL != dynamic_cast<const FloatEditor*>(pEditor) );
-}
-
-BOOST_AUTO_TEST_CASE( TestUpDownEditor)
-{
- TestUpDownGroup testGroup;
-
- const Editor* pEditor = testGroup.get_metadata(PROPERTY_FLOAT_1);
- BOOST_CHECK( pEditor->GetControlType() == UpDown );
-}
\ No newline at end of file

Deleted: sandbox/pinhole/libs/pinhole/test/TestIntegerProperties.cpp
==============================================================================
--- sandbox/pinhole/libs/pinhole/test/TestIntegerProperties.cpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
+++ (empty file)
@@ -1,101 +0,0 @@
-// Boost.Pinhole library
-
-// Copyright Jared McIntyre 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#define BOOST_TEST_MODULE PinholeLib
-#include <boost/test/unit_test.hpp>
-#include "TestClassesAndConstants.h"
-
-// I can hide these two line if I don't do everything in headers
-boost::shared_ptr<property_manager> property_manager::m_instance(new property_manager);
-event_source* event_source::m_instance = 0;
-
-BOOST_AUTO_TEST_CASE( TestIntegerSetGet )
-{
- TestPropertyGroup testGroup;
-
- int iValue;
- testGroup.set_as_string( PROPERTY_INT_1, PROPERTY_INT_1_STRING_VALUE );
- BOOST_CHECK( from_string<int>(iValue, testGroup.get_as_string(PROPERTY_INT_1), std::dec) );
- BOOST_CHECK_EQUAL( iValue, PROPERTY_INT_1_VALUE );
-}
-
-BOOST_AUTO_TEST_CASE( TestIntegerSetGetVar )
-{
- TestPropertyGroup testGroup;
-
- int iValue;
- testGroup.set_as_string( PROPERTY_INT_1_VAR, PROPERTY_INT_1_STRING_VALUE );
- BOOST_CHECK( from_string<int>(iValue, testGroup.get_as_string(PROPERTY_INT_1_VAR), std::dec) );
- BOOST_CHECK_EQUAL( iValue, PROPERTY_INT_1_VALUE );
-}
-
-BOOST_AUTO_TEST_CASE( TestIntegerEditorType )
-{
- TestPropertyGroup_4 testGroup;
-
- BOOST_CHECK( typeid(bool) != testGroup.get_type_info(PROPERTY_INT_1) );
- BOOST_CHECK( typeid(int) == testGroup.get_type_info(PROPERTY_INT_1) );
- BOOST_CHECK( typeid(float) != testGroup.get_type_info(PROPERTY_INT_1) );
- BOOST_CHECK( typeid(double) != testGroup.get_type_info(PROPERTY_INT_1) );
- BOOST_CHECK( typeid(std::string) != testGroup.get_type_info(PROPERTY_INT_1) );
-
- const IntegerEditor *pEditor = dynamic_cast<const IntegerEditor*>(testGroup.get_metadata( PROPERTY_INT_1 ));
- BOOST_CHECK( pEditor != NULL );
- BOOST_CHECK( testGroup.get_metadata(PROPERTY_INT_1)->getEditorPropertyType() == IntegerType );
-}
-
-BOOST_AUTO_TEST_CASE( TestIntegerHighLowIncrement )
-{
- TestPropertyGroup_4 testGroup;
-
- const IntegerEditor *pEditor = dynamic_cast<const IntegerEditor*>(testGroup.get_metadata( PROPERTY_INT_1 ));
- BOOST_CHECK_EQUAL( pEditor->getLowRange(), INT_LOW );
- BOOST_CHECK_EQUAL( pEditor->getHighRange(), INT_HIGH );
- BOOST_CHECK_EQUAL( pEditor->getIncrement(), INT_INCREMENT );
-}
-
-BOOST_AUTO_TEST_CASE( TestIntegerGetControlType )
-{
- TestPropertyGroup_4 testGroup;
-
- const IntegerEditor *pEditor = dynamic_cast<const IntegerEditor*>(testGroup.get_metadata( PROPERTY_INT_1 ));
- BOOST_CHECK( pEditor->GetControlType() == DropDown );
- BOOST_CHECK( pEditor->UseRange() == true );
-}
-
-BOOST_AUTO_TEST_CASE( TestInteger2GetRange )
-{
- TestPropertyGroup_4 testGroup;
-
- const IntegerEditor *pEditor = dynamic_cast<const IntegerEditor*>(testGroup.get_metadata( PROPERTY_INT_2 ));
- BOOST_CHECK( pEditor->UseRange() == false );
-}
-
-BOOST_AUTO_TEST_CASE( TestInteger2GetControlType )
-{
- TestPropertyGroup_4 testGroup;
-
- const IntegerEditor *pEditor = dynamic_cast<const IntegerEditor*>(testGroup.get_metadata( PROPERTY_INT_2 ));
- BOOST_CHECK( pEditor->GetControlType() == EditBox );
-}
-
-BOOST_AUTO_TEST_CASE( TestIntegerGetEditorTypeFailure )
-{
- TestPropertyGroup_5 testGroup;
-
- BOOST_CHECK_THROW( testGroup.get_metadata( PROPERTY_INT_1 ), no_metadata_defined_error );
-}
-
-BOOST_AUTO_TEST_CASE( TestAutoGeneratedDesignerInt )
-{
- TestAutoGeneratedDesigners testGroup;
-
- const Editor* pEditor = testGroup.get_metadata(PROPERTY_INT_1);
- BOOST_CHECK( NULL != dynamic_cast<const IntegerEditor*>(pEditor) );
-}
\ No newline at end of file

Deleted: sandbox/pinhole/libs/pinhole/test/TestPropertyGroupWrapper.cpp
==============================================================================
--- sandbox/pinhole/libs/pinhole/test/TestPropertyGroupWrapper.cpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
+++ (empty file)
@@ -1,153 +0,0 @@
-// Boost.Pinhole library
-
-// Copyright Jared McIntyre 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#define BOOST_TEST_MODULE PinholeLib
-#include <boost/test/unit_test.hpp>
-#include "TestClassesAndConstants.h"
-#include <boost/pinhole/property_group_wrapper.h>
-
-// I can hide these two line if I don't do everything in headers
-boost::shared_ptr<property_manager> property_manager::m_instance(new property_manager);
-event_source* event_source::m_instance = 0;
-
-BOOST_AUTO_TEST_CASE( TestPropertyGroupWrapper_Bool )
-{
- TestPropertyGroup_4 baseObject;
- property_group_wrapper wrapper("test_wrapper", &baseObject);
- const Editor *pEditor;
-
- // Test Standard Creation
- wrapper.add_property(PROPERTY_BOOL, "PropertyBool description", boost::bind(&TestPropertyGroup_4::SetBool, &baseObject, _1), boost::bind(&TestPropertyGroup_4::GetBool, &baseObject), new BoolEditor());
-
- wrapper.set_as_string( PROPERTY_BOOL, BOOL_FALSE );
- BOOST_CHECK( wrapper.get_as_string( PROPERTY_BOOL ) == BOOL_FALSE );
-
- wrapper.set_as_string( PROPERTY_BOOL, BOOL_TRUE );
- BOOST_CHECK( wrapper.get_as_string( PROPERTY_BOOL ) == BOOL_TRUE );
-
- pEditor = wrapper.get_metadata( PROPERTY_BOOL );
- BOOST_CHECK( pEditor->getEditorPropertyType() == BooleanType );
- BOOST_CHECK( pEditor->GetControlType() == Radio );
-
- // Test Auto-Generated Designer Creation
- property_group_wrapper wrapperAutoGenDesigner("test_wrapper", &baseObject);
-
- wrapperAutoGenDesigner.add_property(PROPERTY_BOOL, "PropertyBool description", boost::bind(&TestPropertyGroup_4::SetBool, &baseObject, _1), boost::bind(&TestPropertyGroup_4::GetBool, &baseObject) );
-
- pEditor = wrapperAutoGenDesigner.get_metadata(PROPERTY_BOOL);
- BOOST_CHECK( NULL != dynamic_cast<const BoolEditor*>(pEditor) );
-}
-
-BOOST_AUTO_TEST_CASE( TestPropertyGroupWrapper_Double )
-{
- TestPropertyGroup_5 baseObject;
- property_group_wrapper wrapper("test_wrapper", &baseObject);
- const Editor *pEditor;
-
- // Test Standard Creation
- wrapper.add_property(PROPERTY_DOUBLE, "PropertyDouble description", boost::bind(&TestPropertyGroup_5::SetDouble, &baseObject, _1), boost::bind(&TestPropertyGroup_5::GetDouble, &baseObject), new DoubleEditor() );
-
- double dValue;
- wrapper.set_as_string( PROPERTY_DOUBLE, PROPERTY_DOUBLE_STRING_VALUE );
- BOOST_CHECK( from_string<double>(dValue, wrapper.get_as_string( PROPERTY_DOUBLE), std::dec) );
- BOOST_CHECK_EQUAL( dValue, PROPERTY_DOUBLE_VALUE );
-
- pEditor = wrapper.get_metadata( PROPERTY_DOUBLE );
- BOOST_CHECK( pEditor->getEditorPropertyType() == DoubleType );
- BOOST_CHECK( pEditor->GetControlType() == EditBox );
-
- // Test Auto-Generated Designer Creation
- property_group_wrapper wrapperAutoGenDesigner("test_wrapper", &baseObject);
-
- wrapperAutoGenDesigner.add_property(PROPERTY_DOUBLE, "PropertyDouble description", boost::bind(&TestPropertyGroup_5::SetDouble, &baseObject, _1), boost::bind(&TestPropertyGroup_5::GetDouble, &baseObject) );
-
- pEditor = wrapperAutoGenDesigner.get_metadata(PROPERTY_DOUBLE);
- BOOST_CHECK( NULL != dynamic_cast<const DoubleEditor*>(pEditor) );
-}
-
-BOOST_AUTO_TEST_CASE( TestPropertyGroupWrapper_Float )
-{
- TestPropertyGroup_4 baseObject;
- property_group_wrapper wrapper("test_wrapper", &baseObject);
- const Editor *pEditor;
-
- // Test Standard Creation
- wrapper.add_property(PROPERTY_FLOAT_1, "PropertyFloat1 description", boost::bind(&TestPropertyGroup_4::SetFloat, &baseObject, _1), boost::bind(&TestPropertyGroup_4::GetFloat, &baseObject), new FloatEditor() );
-
- float fValue;
- wrapper.set_as_string( PROPERTY_FLOAT_1, PROPERTY_FLOAT_1_STRING_VALUE );
- BOOST_CHECK( from_string<float>(fValue, wrapper.get_as_string(PROPERTY_FLOAT_1), std::dec) );
- BOOST_CHECK_EQUAL( fValue, PROPERTY_FLOAT_1_VALUE );
-
- pEditor = wrapper.get_metadata( PROPERTY_FLOAT_1 );
- BOOST_CHECK( pEditor->getEditorPropertyType() == FloatType );
- BOOST_CHECK( pEditor->GetControlType() == EditBox );
-
- // Test Auto-Generated Designer Creation
- property_group_wrapper wrapperAutoGenDesigner("test_wrapper", &baseObject);
-
- wrapperAutoGenDesigner.add_property(PROPERTY_FLOAT_1, "PropertyFloat1 description", boost::bind(&TestPropertyGroup_4::SetFloat, &baseObject, _1), boost::bind(&TestPropertyGroup_4::GetFloat, &baseObject) );
-
- pEditor = wrapperAutoGenDesigner.get_metadata(PROPERTY_FLOAT_1);
- BOOST_CHECK( NULL != dynamic_cast<const FloatEditor*>(pEditor) );
-}
-
-BOOST_AUTO_TEST_CASE( TestPropertyGroupWrapper_Integer )
-{
- TestPropertyGroup_4 baseObject;
- property_group_wrapper wrapper("test_wrapper", &baseObject);
- const Editor *pEditor;
-
- // Test Standard Creation
- wrapper.add_property(PROPERTY_INT_1, "PropertyInt1 description", boost::bind(&TestPropertyGroup_4::SetInt, &baseObject, _1), boost::bind(&TestPropertyGroup_4::GetInt, &baseObject), new IntegerEditor(INT_LOW, INT_HIGH, INT_INCREMENT, DropDown));
-
- int iValue;
- wrapper.set_as_string( PROPERTY_INT_1, PROPERTY_INT_1_STRING_VALUE );
- BOOST_CHECK( from_string<int>(iValue, wrapper.get_as_string(PROPERTY_INT_1), std::dec) );
- BOOST_CHECK_EQUAL( iValue, PROPERTY_INT_1_VALUE );
-
- pEditor = wrapper.get_metadata( PROPERTY_INT_1 );
- BOOST_CHECK( pEditor->getEditorPropertyType() == IntegerType );
- BOOST_CHECK( pEditor->GetControlType() == DropDown );
-
- // Test Auto-Generated Designer Creation
- property_group_wrapper wrapperAutoGenDesigner("test_wrapper", &baseObject);
-
- wrapperAutoGenDesigner.add_property(PROPERTY_INT_1, "PropertyInt1 description", boost::bind(&TestPropertyGroup_4::SetInt, &baseObject, _1), boost::bind(&TestPropertyGroup_4::GetInt, &baseObject) );
-
- pEditor = wrapperAutoGenDesigner.get_metadata(PROPERTY_INT_1);
- BOOST_CHECK( NULL != dynamic_cast<const IntegerEditor*>(pEditor) );
-}
-
-BOOST_AUTO_TEST_CASE( TestPropertyGroupWrapper_String )
-{
- TestPropertyGroup baseObject;
- property_group_wrapper wrapper("test_wrapper", &baseObject);
- const Editor *pEditor;
-
- // Test Standard Creation
- wrapper.add_property(PROPERTY_STRING_2, "PropertyString2 description", boost::bind(&TestPropertyGroup::SetPropertyString2, &baseObject, _1), boost::bind(&TestPropertyGroup::GetPropertyString2, &baseObject), new StringEditor());
-
- wrapper.set_as_string( PROPERTY_STRING_2, PROPERTY_STRING_2_VALUE );
- BOOST_CHECK( PROPERTY_STRING_2_VALUE == wrapper.get_as_string( PROPERTY_STRING_2) );
- wrapper.set_as_string( PROPERTY_STRING_2, PROPERTY_STRING_1_VALUE );
- BOOST_CHECK( PROPERTY_STRING_1_VALUE == wrapper.get_as_string( PROPERTY_STRING_2) );
-
- pEditor = wrapper.get_metadata( PROPERTY_STRING_2 );
- BOOST_CHECK( pEditor->getEditorPropertyType() == StringType );
- BOOST_CHECK( pEditor->GetControlType() == EditBox );
-
- // Test Auto-Generated Designer Creation
- property_group_wrapper wrapperAutoGenDesigner("test_wrapper", &baseObject);
-
- wrapperAutoGenDesigner.add_property(PROPERTY_STRING_2, "PropertyString2 description", boost::bind(&TestPropertyGroup::SetPropertyString2, &baseObject, _1), boost::bind(&TestPropertyGroup::GetPropertyString2, &baseObject) );
-
- pEditor = wrapperAutoGenDesigner.get_metadata(PROPERTY_STRING_2);
- BOOST_CHECK( NULL != dynamic_cast<const StringEditor*>(pEditor) );
-}
\ No newline at end of file

Deleted: sandbox/pinhole/libs/pinhole/test/TestPropertyGroups.cpp
==============================================================================
--- sandbox/pinhole/libs/pinhole/test/TestPropertyGroups.cpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
+++ (empty file)
@@ -1,305 +0,0 @@
-// Boost.Pinhole library
-
-// Copyright Jared McIntyre 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#define BOOST_TEST_MODULE PinholeLib
-#include <boost/test/unit_test.hpp>
-#include "TestClassesAndConstants.h"
-#include <boost/pinhole/find.h>
-
-// I can hide these two line if I don't do everything in headers
-boost::shared_ptr<property_manager> property_manager::m_instance(new property_manager);
-event_source* event_source::m_instance = 0;
-
-class TestPropertyManager : public property_manager
-{
-public:
- TestPropertyManager() : property_manager()
- {
- property_manager::m_instance.reset( this );
-
- uiChildCount = 0;
- uiSelectSingleNodeCallCount = 0;
- uiRegisterPropertyGroupCallCount = 0;
- uiUnRegisterPropertyGroupCallCount = 0;
- uiAddCategoryCallCount = 0;
- }
- virtual property_group* select_single_node(property_group* pCurrentPropertyGroup, const string& xpath)
- {
- ++uiSelectSingleNodeCallCount;
-
- return 0;
- }
- virtual void register_property_group( property_group *pPropertyGroup )
- {
- ++uiRegisterPropertyGroupCallCount;
-
- if( NULL == pPropertyGroup->get_parent() )
- {
- ++uiChildCount;
- }
- }
- virtual void unregister_property_group( property_group *pPropertyGroup, category_collection &categories )
- {
- ++uiUnRegisterPropertyGroupCallCount;
-
- if( NULL == pPropertyGroup->get_parent() )
- {
- --uiChildCount;
- }
- }
- virtual void AddCategory( const string &sCategoryName, property_group *pPropertyGroup )
- {
- ++uiAddCategoryCallCount;
- }
-
- unsigned int uiChildCount;
- unsigned int uiSelectSingleNodeCallCount;
- unsigned int uiRegisterPropertyGroupCallCount;
- unsigned int uiUnRegisterPropertyGroupCallCount;
- unsigned int uiAddCategoryCallCount;
-};
-
-class TestPropertyManagerGuard
-{
- public:
- TestPropertyManagerGuard()
- {
- property_manager::delete_instance();
-
- p_manager = new TestPropertyManager();
- }
-
- ~TestPropertyManagerGuard()
- {
- property_manager::delete_instance();
- }
-
- TestPropertyManager *p_manager;
-};
-
-BOOST_AUTO_TEST_CASE( TestPropertyParent )
-{
- TestPropertyGroup testGroup;
-
- BOOST_CHECK( testGroup.get_parent() == NULL );
- BOOST_CHECK( testGroup.m_child1.get_parent() == (property_group*)&testGroup );
-}
-
-BOOST_AUTO_TEST_CASE( TestPropertyGroupGetName )
-{
- TestPropertyGroup testGroup;
-
- BOOST_CHECK( testGroup.get_name() == PROPERTY_GROUP_NAME );
-}
-
-BOOST_AUTO_TEST_CASE( TestBogusPropertyNameForEditor )
-{
- TestPropertyGroup_4 testGroup;
-
- BOOST_CHECK_THROW( testGroup.get_metadata( "bogus property name" ), std::out_of_range );
-}
-
-BOOST_AUTO_TEST_CASE( TestDynamicAddingAndReadingOfPropertyGroups )
-{
- // TODO: implement test for dynamic property groups
-}
-
-BOOST_AUTO_TEST_CASE( TestNumberOfProperties )
-{
- TestPropertyGroup_5 testGroup;
-
- BOOST_CHECK_EQUAL( testGroup.prop_count(), 7u );
-}
-
-BOOST_AUTO_TEST_CASE( TestPropertyIteration )
-{
- TestPropertyGroup_5 testGroup;
-
- property_group::prop_iterator itr = testGroup.prop_begin();
- BOOST_CHECK_EQUAL( (*itr), PROPERTY_BOOL );
- ++itr;
- BOOST_CHECK_EQUAL( (*itr), PROPERTY_DOUBLE );
- ++itr;
- BOOST_CHECK_EQUAL( (*itr), PROPERTY_DOUBLE_2 );
- ++itr;
- BOOST_CHECK_EQUAL( (*itr), PROPERTY_DOUBLE_VAR );
- ++itr;
- BOOST_CHECK_EQUAL( (*itr), PROPERTY_FLOAT_1 );
- ++itr;
- BOOST_CHECK_EQUAL( (*itr), PROPERTY_INT_1 );
- ++itr;
- BOOST_CHECK_EQUAL( (*itr), PROPERTY_STRING_2 );
- ++itr;
- BOOST_CHECK( testGroup.prop_end() == itr );
-}
-
-BOOST_AUTO_TEST_CASE( TestPropertyGroupCategory )
-{
- TestPropertyGroup_5 testGroup;
-
- testGroup.add_category( PROPERTY_GROUP_CATEGORY1 );
- testGroup.add_category( PROPERTY_GROUP_CATEGORY2 );
- testGroup.add_category( PROPERTY_GROUP_CATEGORY3 );
- testGroup.add_category( PROPERTY_GROUP_CATEGORY3 ); // duplicate should not be inserted
-
- BOOST_CHECK( testGroup.get_category_collection().size() == 4 ); // there is also an 'All' category which automatically gets added
-
- category_collection::const_iterator pos = find( testGroup.get_category_collection().begin(), testGroup.get_category_collection().end(), PROPERTY_GROUP_CATEGORY1 );
- BOOST_CHECK( *pos == PROPERTY_GROUP_CATEGORY1 );
- pos = find( testGroup.get_category_collection().begin(), testGroup.get_category_collection().end(), PROPERTY_GROUP_CATEGORY2 );
- BOOST_CHECK( *pos == PROPERTY_GROUP_CATEGORY2 );
- pos = find( testGroup.get_category_collection().begin(), testGroup.get_category_collection().end(), PROPERTY_GROUP_CATEGORY3 );
- BOOST_CHECK( *pos == PROPERTY_GROUP_CATEGORY3 );
- pos = find( testGroup.get_category_collection().begin(), testGroup.get_category_collection().end(), "bogus category" );
- BOOST_CHECK( pos == testGroup.get_category_collection().end() );
-}
-
-
-BOOST_AUTO_TEST_CASE( TestSingletonPropertyManager )
-{
- TestPropertyManagerGuard gaurd;
- TestPropertyManager *p_manager = gaurd.p_manager;
-
- BOOST_CHECK( property_manager::instance() == p_manager );
-}
-
-BOOST_AUTO_TEST_CASE( TestSetParent )
-{
- TestPropertyManagerGuard gaurd;
- TestPropertyManager *p_manager = gaurd.p_manager;
-
- // The first item should parent to root
- TestPropertyChildGroup_1 rootGroup(NULL);
- BOOST_CHECK_EQUAL( p_manager->uiRegisterPropertyGroupCallCount, 1u );
- BOOST_CHECK_EQUAL( p_manager->uiUnRegisterPropertyGroupCallCount, 0u );
- BOOST_CHECK_EQUAL( p_manager->uiChildCount, 1u );
-
- // The second item should parent to the first
- TestPropertyChildGroup_1 childGroup(&rootGroup);
- BOOST_CHECK_EQUAL( p_manager->uiRegisterPropertyGroupCallCount, 2u );
- BOOST_CHECK_EQUAL( p_manager->uiUnRegisterPropertyGroupCallCount, 0u );
- BOOST_CHECK_EQUAL( p_manager->uiChildCount, 1u );
- BOOST_CHECK_EQUAL( rootGroup.get_children_collection().size(), 1u );
- BOOST_CHECK( &rootGroup == childGroup.get_parent() );
-
- // Reparent child to root
- childGroup.set_parent(NULL);
- BOOST_CHECK_EQUAL( p_manager->uiRegisterPropertyGroupCallCount, 3u );
- BOOST_CHECK_EQUAL( p_manager->uiUnRegisterPropertyGroupCallCount, 1u );
- BOOST_CHECK_EQUAL( p_manager->uiChildCount, 2u );
- BOOST_CHECK_EQUAL( rootGroup.get_children_collection().size(), 0u );
- BOOST_CHECK( NULL == childGroup.get_parent() );
-
- // Reparent child to rootGroup
- childGroup.set_parent(&rootGroup);
- BOOST_CHECK_EQUAL( p_manager->uiRegisterPropertyGroupCallCount, 4u );
- BOOST_CHECK_EQUAL( p_manager->uiUnRegisterPropertyGroupCallCount, 2u );
- BOOST_CHECK_EQUAL( p_manager->uiChildCount, 1u );
- BOOST_CHECK_EQUAL( rootGroup.get_children_collection().size(), 1u );
- BOOST_CHECK( &rootGroup == childGroup.get_parent() );
-}
-
-BOOST_AUTO_TEST_CASE( TestAutoReparentToRootInDestructor )
-{
- TestPropertyManagerGuard gaurd;
- TestPropertyManager *p_manager = gaurd.p_manager;
-
- // The first item should parent to root
- TestPropertyChildGroup_1 *pRootGroup = new TestPropertyChildGroup_1(NULL);
- BOOST_CHECK_EQUAL( p_manager->uiRegisterPropertyGroupCallCount, 1u );
- BOOST_CHECK_EQUAL( p_manager->uiUnRegisterPropertyGroupCallCount, 0u );
- BOOST_CHECK_EQUAL( p_manager->uiChildCount, 1u );
-
- // The second item should parent to the first
- TestPropertyChildGroup_1 childGroup(pRootGroup);
- BOOST_CHECK_EQUAL( p_manager->uiRegisterPropertyGroupCallCount, 2u );
- BOOST_CHECK_EQUAL( p_manager->uiUnRegisterPropertyGroupCallCount, 0u );
- BOOST_CHECK_EQUAL( p_manager->uiChildCount, 1u );
- BOOST_CHECK_EQUAL( pRootGroup->get_children_collection().size(), 1u );
- BOOST_CHECK( pRootGroup == childGroup.get_parent() );
-
- // Delete rootGroup.
- // This should cause childGroup to be reparented to root.
- delete pRootGroup;
- BOOST_CHECK_EQUAL( p_manager->uiRegisterPropertyGroupCallCount, 3u );
- BOOST_CHECK_EQUAL( p_manager->uiUnRegisterPropertyGroupCallCount, 2u );
- BOOST_CHECK_EQUAL( p_manager->uiChildCount, 1u );
- BOOST_CHECK( NULL == childGroup.get_parent() );
-}
-
-// This is counter intuitive, but by default, if an object inherits from property_group,
-// adds properties, and that object doesn't have a copy constructor, it is important that
-// the old properties aren't copied over. This is because the property_group object can't
-// properly re-hook the function pointers up to the new object. This stops crashes in
-// the system, though the object should provide it's own copy constructor to add the new
-// properties in which case this wouldn't be an issue.
-BOOST_AUTO_TEST_CASE( TestNoCopyConstructorProperties )
-{
- TestPropertyGroup_5 testGroup;
- // For this test, TestPropertyGroup_5 shouldn't have a copy constructor
- TestPropertyGroup_5 copiedGroup( testGroup );
-
- BOOST_CHECK_EQUAL( copiedGroup.prop_count(), 0u );
-
- // This is here, because if this test fails, and we don't clear
- // the properties, and the test app can hang when copiedGroup is destroyed.
- testGroup.clear_properties();
-}
-
-// This is counter intuitive, but by default, if an object inherits from property_group,
-// adds actions, and that object doesn't have a copy constructor, it is important that
-// the old actions aren't copied over. This is because the property_group object can't
-// properly re-hook the function pointers up to the new object. This stops crashes in
-// the system, though the object should provide it's own copy constructor to add the new
-// actions in which case this wouldn't be an issue.
-BOOST_AUTO_TEST_CASE( TestNoCopyConstructorActions )
-{
- TestActionsFixture testGroup;
- // For this test, TestActionsFixture shouldn't have a copy constructor
- TestActionsFixture copiedGroup( testGroup );
-
- BOOST_CHECK_EQUAL( copiedGroup.action_count(), 0u );
-
- // This is here, because if this test fails, and we don't clear
- // the actions, the test app will hang when copiedGroup is destroyed.
- testGroup.clear_actions();
-}
-
-BOOST_AUTO_TEST_CASE( TestCopyConstructor_RootObject )
-{
- TestPropertyGroup_5 testGroup;
- TestPropertyGroup_5 copiedGroup( testGroup );
-
- BOOST_CHECK_EQUAL( copiedGroup.get_name().compare(PROPERTY_GROUP_NAME), 0 );
- BOOST_CHECK( NULL == copiedGroup.get_parent() );
-
- // This is here, because if Copy Constructor isn't right, and we don't clear
- // the properties, the test app will hang when copied Group is destroyed.
- testGroup.clear_properties();
-}
-
-BOOST_AUTO_TEST_CASE( TestCopyConstructor_ChildObject )
-{
- TestPropertyGroup_5 testGroup;
- TestPropertyChildGroup_1 group(&testGroup);
- TestPropertyChildGroup_1 copiedGroup(&group);
-
- BOOST_CHECK_EQUAL( copiedGroup.get_name().compare(PROPERTY_GROUP_CHILD_NAME), 0 );
- BOOST_CHECK( &group == copiedGroup.get_parent() );
-}
-
-BOOST_AUTO_TEST_CASE( TestIsReadOnly )
-{
- TestPropertyGroup testGroup;
-
- BOOST_CHECK_EQUAL( testGroup.is_read_only(PROPERTY_STRING_1), true );
- BOOST_CHECK_EQUAL( testGroup.is_read_only(PROPERTY_FLOAT_1), false );
-}
-
-// test throw on readonly set
\ No newline at end of file

Deleted: sandbox/pinhole/libs/pinhole/test/TestStringProperties.cpp
==============================================================================
--- sandbox/pinhole/libs/pinhole/test/TestStringProperties.cpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
+++ (empty file)
@@ -1,84 +0,0 @@
-// Boost.Pinhole library
-
-// Copyright Jared McIntyre 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#define BOOST_TEST_MODULE PinholeLib
-#include <boost/test/unit_test.hpp>
-#include "TestClassesAndConstants.h"
-
-// I can hide these two line if I don't do everything in headers
-boost::shared_ptr<property_manager> property_manager::m_instance(new property_manager);
-event_source* event_source::m_instance = 0;
-
-BOOST_AUTO_TEST_CASE( TestGetString )
-{
- TestPropertyGroup testGroup;
-
- BOOST_CHECK( testGroup.get_as_string(PROPERTY_STRING_1) == PROPERTY_STRING_1_VALUE );
-}
-
-BOOST_AUTO_TEST_CASE( TestNoSetterReadOnly )
-{
- TestPropertyGroup testGroup;
-
- BOOST_CHECK_EQUAL( testGroup.is_read_only(PROPERTY_STRING_1), true );
-}
-
-BOOST_AUTO_TEST_CASE( TestNoSetterStringFail )
-{
- TestPropertyGroup testGroup;
-
- BOOST_CHECK_THROW( testGroup.set_as_string(PROPERTY_STRING_1, PROPERTY_STRING_1_VALUE), boost::bad_function_call );
-}
-
-BOOST_AUTO_TEST_CASE( TestSetGetString )
-{
- TestPropertyGroup testGroup;
-
- testGroup.set_as_string( PROPERTY_STRING_2, PROPERTY_STRING_2_VALUE );
- BOOST_CHECK( PROPERTY_STRING_2_VALUE == testGroup.get_as_string( PROPERTY_STRING_2) );
-}
-
-BOOST_AUTO_TEST_CASE( TestSetGetStringVar )
-{
- TestPropertyGroup testGroup;
-
- testGroup.set_as_string( PROPERTY_STRING_2_VAR, PROPERTY_STRING_2_VALUE );
- BOOST_CHECK_EQUAL( testGroup.get_as_string( PROPERTY_STRING_2_VAR), PROPERTY_STRING_2_VALUE );
-}
-
-BOOST_AUTO_TEST_CASE( TestStringPropertyType )
-{
- TestPropertyGroup_4 testGroup;
-
- BOOST_CHECK( typeid(bool) != testGroup.get_type_info(PROPERTY_STRING_2) );
- BOOST_CHECK( typeid(int) != testGroup.get_type_info(PROPERTY_STRING_2) );
- BOOST_CHECK( typeid(float) != testGroup.get_type_info(PROPERTY_STRING_2) );
- BOOST_CHECK( typeid(double) != testGroup.get_type_info(PROPERTY_STRING_2) );
- BOOST_CHECK( typeid(std::string) == testGroup.get_type_info(PROPERTY_STRING_2) );
-
- const StringEditor *pEditor = dynamic_cast<const StringEditor*>(testGroup.get_metadata( PROPERTY_STRING_2 ));
- BOOST_CHECK( pEditor != NULL );
- BOOST_CHECK( testGroup.get_metadata(PROPERTY_STRING_2)->getEditorPropertyType() == StringType );
-}
-
-BOOST_AUTO_TEST_CASE( TestStringGetControlType )
-{
- TestPropertyGroup_4 testGroup;
-
- const StringEditor *pEditor = dynamic_cast<const StringEditor*>(testGroup.get_metadata( PROPERTY_STRING_2 ));
- BOOST_CHECK( pEditor->GetControlType() == EditBox );
-}
-
-BOOST_AUTO_TEST_CASE( TestAutoGeneratedDesignerString )
-{
- TestAutoGeneratedDesigners testGroup;
-
- const Editor* pEditor = testGroup.get_metadata(PROPERTY_STRING_1);
- BOOST_CHECK( NULL != dynamic_cast<const StringEditor*>(pEditor) );
-}

Deleted: sandbox/pinhole/libs/pinhole/test/UtilityMisc.h
==============================================================================
--- sandbox/pinhole/libs/pinhole/test/UtilityMisc.h 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
+++ (empty file)
@@ -1,65 +0,0 @@
-// Boost.Print library
-
-// Copyright Jared McIntyre 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#include <windows.h>
-
-#include <string>
-#include <boost/algorithm/string.hpp>
-#include <boost/algorithm/string/find.hpp>
-#include <boost/filesystem/operations.hpp>
-#include <boost/filesystem/fstream.hpp>
-
-using namespace std;
-using namespace boost;
-
-string getPathForModule(const char* szModuleName)
-{
- TCHAR buf[MAX_PATH] = "";
- HMODULE hModule = ::GetModuleHandle(szModuleName);
- ::GetModuleFileName(hModule, buf, sizeof(buf));
- string strExePath(buf);
- return strExePath;
-}
-
-string getParentDirectory(int nRelativePathLevel)
-{
- string strExePath = getPathForModule(NULL);
-
- filesystem::path full_path = filesystem::system_complete( filesystem::path(strExePath.c_str(), filesystem::native ));
- for(int nLevel = 0; nLevel < nRelativePathLevel; nLevel++)
- {
- full_path = full_path.branch_path();
- }
- string strFullPathLocal = full_path.string();
- string strParent = strFullPathLocal + "\\";
- return strParent;
-}
-
-string getTestDataDirectory()
-{
- string strBranchPath = getParentDirectory(3);
- string strTestDataDirectory = strBranchPath + "UnitTests\\TestProperties\\Test Data Files\\";
- return strTestDataDirectory;
-}
-
-class MscCurrentDirectoryHelper
-{
-public:
- MscCurrentDirectoryHelper(const char* newDir)
- {
- GetCurrentDirectory(MAX_PATH, m_oldCurrentPath);
- SetCurrentDirectory(newDir);
- }
- ~MscCurrentDirectoryHelper()
- {
- SetCurrentDirectory(m_oldCurrentPath);
- }
-private:
- char m_oldCurrentPath[MAX_PATH];
-};

Copied: sandbox/pinhole/libs/pinhole/test/test_actions.cpp (from r41666, /sandbox/pinhole/libs/pinhole/test/TestActions.cpp)
==============================================================================
--- /sandbox/pinhole/libs/pinhole/test/TestActions.cpp (original)
+++ sandbox/pinhole/libs/pinhole/test/test_actions.cpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
@@ -9,7 +9,7 @@
 
 #define BOOST_TEST_MODULE PinholeLib
 #include <boost/test/unit_test.hpp>
-#include "TestClassesAndConstants.h"
+#include "TestClassesAndConstants.hpp"
 
 // I can hide these two line if I don't do everything in headers
 boost::shared_ptr<property_manager> property_manager::m_instance(new property_manager);

Copied: sandbox/pinhole/libs/pinhole/test/test_bool_properties.cpp (from r41666, /sandbox/pinhole/libs/pinhole/test/TestBoolProperties.cpp)
==============================================================================
--- /sandbox/pinhole/libs/pinhole/test/TestBoolProperties.cpp (original)
+++ sandbox/pinhole/libs/pinhole/test/test_bool_properties.cpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
@@ -8,75 +8,136 @@
 // For more information, see http://www.boost.org
 
 #define BOOST_TEST_MODULE PinholeLib
+
+#include <boost/pinhole/property_group.hpp>
+#include <boost/pinhole/property_manager.hpp>
 #include <boost/test/unit_test.hpp>
-#include "TestClassesAndConstants.h"
+
+using namespace std;
+using namespace boost;
+using namespace boost::pinhole;
+
 
 // I can hide these two line if I don't do everything in headers
-boost::shared_ptr<property_manager> property_manager::m_instance(new property_manager);
+shared_ptr<property_manager> property_manager::m_instance(new property_manager);
 event_source* event_source::m_instance = 0;
 
-BOOST_AUTO_TEST_CASE( TestSetGetBool )
+class TestGroup : public property_group
 {
- TestPropertyGroup testGroup;
-
- testGroup.set_as_string( PROPERTY_STRING_2, PROPERTY_STRING_2_VALUE );
- BOOST_CHECK( PROPERTY_STRING_2_VALUE == testGroup.get_as_string( PROPERTY_STRING_2) );
-}
+public:
+#if defined(BOOST_MSVC)
+ #pragma warning(push)
+ #pragma warning( disable: 4355 )
+#endif
+ TestGroup() : property_group( "PropertyGroupName", NULL )
+ {
+ m_bool_Func = true;
+ m_bool_Var = true;
+
+ add_property("Bool_Func", "Bool1 description", BOOST_SETTER(&TestGroup::SetBool), BOOST_GETTER(&TestGroup::GetBool), NULL );
+ add_property("Bool_Var", "Bool2 description", BOOST_SETTER_VAR(m_bool_Var), BOOST_GETTER_VAR(m_bool_Var), NULL );
+ }
+#if defined(BOOST_MSVC)
+ #pragma warning(pop)
+#endif
+
+ void SetBool( bool x ){ m_bool_Func = x; }
+ bool GetBool(){ return( m_bool_Func ); }
+
+private:
+ bool m_bool_Func;
+ bool m_bool_Var;
+};
 
-BOOST_AUTO_TEST_CASE( TestSetGetBoolVar )
+BOOST_AUTO_TEST_CASE( TestSetGetBool_Func )
 {
- TestPropertyGroup testGroup;
+ TestGroup testGroup;
+
+ testGroup.set( "Bool_Func", false );
+ BOOST_CHECK( false == testGroup.get<bool>( "Bool_Func") );
     
- testGroup.set_as_string( PROPERTY_BOOL_VAR, PROPERTY_BOOL_VALUE );
- BOOST_CHECK_EQUAL( testGroup.get_as_string( PROPERTY_BOOL_VAR), PROPERTY_BOOL_VALUE );
-}
+ testGroup.set_as_string( "Bool_Func", "true" );
+ BOOST_CHECK( "True" == testGroup.get_as_string( "Bool_Func") );
 
-BOOST_AUTO_TEST_CASE( TestBoolPropertyType )
-{
- TestPropertyGroup_4 testGroup;
+ testGroup.set_as_string( "Bool_Func", "false" );
+ BOOST_CHECK( "False" == testGroup.get_as_string( "Bool_Func") );
     
- BOOST_CHECK( typeid(bool) == testGroup.get_type_info(PROPERTY_BOOL) );
- BOOST_CHECK( typeid(int) != testGroup.get_type_info(PROPERTY_BOOL) );
- BOOST_CHECK( typeid(float) != testGroup.get_type_info(PROPERTY_BOOL) );
- BOOST_CHECK( typeid(double) != testGroup.get_type_info(PROPERTY_BOOL) );
- BOOST_CHECK( typeid(std::string) != testGroup.get_type_info(PROPERTY_BOOL) );
-
- const BoolEditor *pEditor = dynamic_cast<const BoolEditor*>(testGroup.get_metadata( PROPERTY_BOOL ));
- BOOST_CHECK( pEditor != NULL );
- BOOST_CHECK( testGroup.get_metadata(PROPERTY_BOOL)->getEditorPropertyType() == BooleanType );
-}
+ testGroup.set_as_string( "Bool_Func", "True" );
+ BOOST_CHECK( "True" == testGroup.get_as_string( "Bool_Func") );
 
-BOOST_AUTO_TEST_CASE( TestBoolGetControlType )
-{
- TestPropertyGroup_4 testGroup;
+ testGroup.set_as_string( "Bool_Func", "False" );
+ BOOST_CHECK( "False" == testGroup.get_as_string( "Bool_Func") );
     
- const BoolEditor *pEditor = dynamic_cast<const BoolEditor*>(testGroup.get_metadata( PROPERTY_BOOL ));
- BOOST_CHECK( pEditor->GetControlType() == Radio );
-}
+ testGroup.set( "Bool_Func", false );
+ testGroup.set_as_string( "Bool_Func", "TrUe" );
+ BOOST_CHECK( "True" == testGroup.get_as_string( "Bool_Func") );
 
-BOOST_AUTO_TEST_CASE( TestBoolGetSet )
-{
- TestPropertyGroup_4 testGroup;
+ testGroup.set_as_string( "Bool_Func", "FalSe" );
+ BOOST_CHECK( "False" == testGroup.get_as_string( "Bool_Func") );
+
+ testGroup.set( "Bool_Func", false );
+ testGroup.set_as_string( "Bool_Func", "TRUE" );
+ BOOST_CHECK( "True" == testGroup.get_as_string( "Bool_Func") );
+
+ testGroup.set_as_string( "Bool_Func", "FALSE" );
+ BOOST_CHECK( "False" == testGroup.get_as_string( "Bool_Func") );
     
- testGroup.set_as_string( PROPERTY_BOOL, BOOL_TRUE );
- BOOST_CHECK( testGroup.get_as_string( PROPERTY_BOOL ) == BOOL_TRUE );
+ testGroup.set( "Bool_Func", false );
+ testGroup.set_as_string( "Bool_Func", "1" );
+ BOOST_CHECK( "True" == testGroup.get_as_string( "Bool_Func") );
 
- testGroup.set_as_string( PROPERTY_BOOL, BOOL_FALSE );
- BOOST_CHECK( testGroup.get_as_string( PROPERTY_BOOL ) == BOOL_FALSE );
+ testGroup.set_as_string( "Bool_Func", "0" );
+ BOOST_CHECK( "False" == testGroup.get_as_string( "Bool_Func") );
 }
 
-BOOST_AUTO_TEST_CASE( TestInvalidSet )
+BOOST_AUTO_TEST_CASE( TestSetGetBool_Var )
 {
- TestPropertyGroup_4 testGroup;
+ TestGroup testGroup;
+
+ testGroup.set( "Bool_Var", false );
+ BOOST_CHECK( false == testGroup.get<bool>( "Bool_Var") );
+
+ testGroup.set_as_string( "Bool_Var", "true" );
+ BOOST_CHECK( "True" == testGroup.get_as_string( "Bool_Var") );
+
+ testGroup.set_as_string( "Bool_Var", "false" );
+ BOOST_CHECK( "False" == testGroup.get_as_string( "Bool_Var") );
+
+ testGroup.set_as_string( "Bool_Var", "True" );
+ BOOST_CHECK( "True" == testGroup.get_as_string( "Bool_Var") );
+
+ testGroup.set_as_string( "Bool_Var", "False" );
+ BOOST_CHECK( "False" == testGroup.get_as_string( "Bool_Var") );
+
+ testGroup.set( "Bool_Var", false );
+ testGroup.set_as_string( "Bool_Var", "TrUe" );
+ BOOST_CHECK( "True" == testGroup.get_as_string( "Bool_Var") );
+
+ testGroup.set_as_string( "Bool_Var", "FalSe" );
+ BOOST_CHECK( "False" == testGroup.get_as_string( "Bool_Var") );
     
- // TODO
- testGroup.set_as_string( PROPERTY_BOOL, "Foo" );
+ testGroup.set( "Bool_Var", false );
+ testGroup.set_as_string( "Bool_Var", "TRUE" );
+ BOOST_CHECK( "True" == testGroup.get_as_string( "Bool_Var") );
+
+ testGroup.set_as_string( "Bool_Var", "FALSE" );
+ BOOST_CHECK( "False" == testGroup.get_as_string( "Bool_Var") );
+
+ testGroup.set( "Bool_Var", false );
+ testGroup.set_as_string( "Bool_Var", "1" );
+ BOOST_CHECK( "True" == testGroup.get_as_string( "Bool_Var") );
+
+ testGroup.set_as_string( "Bool_Var", "0" );
+ BOOST_CHECK( "False" == testGroup.get_as_string( "Bool_Var") );
 }
 
-BOOST_AUTO_TEST_CASE( TestAutoGeneratedDesignerBool )
+BOOST_AUTO_TEST_CASE( TestBoolPropertyType )
 {
- TestAutoGeneratedDesigners testGroup;
+ TestGroup testGroup;
     
- const Editor* pEditor = testGroup.get_metadata(PROPERTY_BOOL);
- BOOST_CHECK( NULL != dynamic_cast<const BoolEditor*>(pEditor) );
+ BOOST_CHECK( typeid(bool) == testGroup.get_type_info("Bool_Func") );
+ BOOST_CHECK( typeid(int) != testGroup.get_type_info("Bool_Func") );
+ BOOST_CHECK( typeid(float) != testGroup.get_type_info("Bool_Func") );
+ BOOST_CHECK( typeid(double) != testGroup.get_type_info("Bool_Func") );
+ BOOST_CHECK( typeid(std::string) != testGroup.get_type_info("Bool_Func") );
 }

Copied: sandbox/pinhole/libs/pinhole/test/test_double_properties.cpp (from r41666, /sandbox/pinhole/libs/pinhole/test/TestDoubleProperties.cpp)
==============================================================================
--- /sandbox/pinhole/libs/pinhole/test/TestDoubleProperties.cpp (original)
+++ sandbox/pinhole/libs/pinhole/test/test_double_properties.cpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
@@ -8,78 +8,82 @@
 // For more information, see http://www.boost.org
 
 #define BOOST_TEST_MODULE PinholeLib
+
+#include <boost/pinhole/property_group.hpp>
+#include <boost/pinhole/property_manager.hpp>
 #include <boost/test/unit_test.hpp>
-#include "TestClassesAndConstants.h"
+
+using namespace std;
+using namespace boost;
+using namespace boost::pinhole;
+
+class TestGroup : public property_group
+{
+public:
+#if defined(BOOST_MSVC)
+ #pragma warning(push)
+ #pragma warning( disable: 4355 )
+#endif
+ TestGroup() : property_group( "PropertyGroupName", NULL )
+ {
+ m_double_Func = 1.1;
+ m_double_Var = 1.1;
+
+ add_property("Double_Func", "Double1 description", BOOST_SETTER(&TestGroup::SetDouble), BOOST_GETTER(&TestGroup::GetDouble), NULL );
+ add_property("Double_Var", "Double2 description", BOOST_SETTER_VAR(m_double_Var), BOOST_GETTER_VAR(m_double_Var), NULL );
+ }
+#if defined(BOOST_MSVC)
+ #pragma warning(pop)
+#endif
+
+ void SetDouble( double x ){ m_double_Func = x; }
+ double GetDouble(){ return( m_double_Func ); }
+
+private:
+ double m_double_Func;
+ double m_double_Var;
+};
 
 // I can hide these two line if I don't do everything in headers
 boost::shared_ptr<property_manager> property_manager::m_instance(new property_manager);
 event_source* event_source::m_instance = 0;
 
-BOOST_AUTO_TEST_CASE( TestSetGetDouble )
+BOOST_AUTO_TEST_CASE( TestSetGetDouble_Func )
 {
- TestPropertyGroup_5 testGroup;
-
- double dValue;
- testGroup.set_as_string( PROPERTY_DOUBLE, PROPERTY_DOUBLE_STRING_VALUE );
- BOOST_CHECK( from_string<double>(dValue, testGroup.get_as_string( PROPERTY_DOUBLE), std::dec) );
- BOOST_CHECK_EQUAL( dValue, PROPERTY_DOUBLE_VALUE );
-}
+ TestGroup testGroup;
 
-BOOST_AUTO_TEST_CASE( TestSetGetDoubleVar )
-{
- TestPropertyGroup_5 testGroup;
+ testGroup.set( "Double_Func", 2.2 );
+ BOOST_CHECK( 2.2 == testGroup.get<double>( "Double_Func") );
     
- double dValue;
- testGroup.set_as_string( PROPERTY_DOUBLE_VAR, PROPERTY_DOUBLE_STRING_VALUE );
- BOOST_CHECK( from_string<double>(dValue, testGroup.get_as_string( PROPERTY_DOUBLE_VAR), std::dec) );
- BOOST_CHECK_EQUAL( dValue, PROPERTY_DOUBLE_VALUE );
+ testGroup.set_as_string( "Double_Func", "3.3" );
+ BOOST_CHECK( "3.3" == testGroup.get_as_string( "Double_Func") );
 }
 
-BOOST_AUTO_TEST_CASE( TestDoublePropertyType )
+BOOST_AUTO_TEST_CASE( TestSetGetDouble_Var )
 {
- TestPropertyGroup_5 testGroup;
-
- BOOST_CHECK( typeid(bool) != testGroup.get_type_info(PROPERTY_DOUBLE_2) );
- BOOST_CHECK( typeid(int) != testGroup.get_type_info(PROPERTY_DOUBLE_2) );
- BOOST_CHECK( typeid(float) != testGroup.get_type_info(PROPERTY_DOUBLE_2) );
- BOOST_CHECK( typeid(double) == testGroup.get_type_info(PROPERTY_DOUBLE_2) );
- BOOST_CHECK( typeid(std::string) != testGroup.get_type_info(PROPERTY_DOUBLE_2) );
-
- const DoubleEditor *pEditor = dynamic_cast<const DoubleEditor*>(testGroup.get_metadata( PROPERTY_DOUBLE_2 ));
- BOOST_CHECK( pEditor != NULL );
- BOOST_CHECK( testGroup.get_metadata(PROPERTY_DOUBLE_2)->getEditorPropertyType() == DoubleType );
-}
+ TestGroup testGroup;
 
-BOOST_AUTO_TEST_CASE( TestDoubleGetUIOverrideType )
-{
- TestPropertyGroup_5 testGroup;
+ testGroup.set( "Double_Var", 2.2 );
+ BOOST_CHECK( 2.2 == testGroup.get<double>( "Double_Var") );
     
- const DoubleEditor *pEditor = dynamic_cast<const DoubleEditor*>(testGroup.get_metadata( PROPERTY_DOUBLE_2 ));
- BOOST_CHECK( pEditor->GetControlType() == Tracker );
+ testGroup.set_as_string( "Double_Var", "3.3" );
+ BOOST_CHECK( "3.3" == testGroup.get_as_string( "Double_Var") );
 }
 
-BOOST_AUTO_TEST_CASE( TestDoubleHighLowIncrement )
+BOOST_AUTO_TEST_CASE( TestDoublePropertyType )
 {
- TestPropertyGroup_5 testGroup;
+ TestGroup testGroup;
     
- const DoubleEditor *pEditor = dynamic_cast<const DoubleEditor*>(testGroup.get_metadata( PROPERTY_DOUBLE_2 ));
- BOOST_CHECK( DOUBLE_LOW == pEditor->getLowRange() );
- BOOST_CHECK( DOUBLE_HIGH == pEditor->getHighRange() );
- BOOST_CHECK( DOUBLE_INCREMENT == pEditor->getIncrement() );
+ BOOST_CHECK( typeid(bool) != testGroup.get_type_info("Double_Func") );
+ BOOST_CHECK( typeid(int) != testGroup.get_type_info("Double_Func") );
+ BOOST_CHECK( typeid(float) != testGroup.get_type_info("Double_Func") );
+ BOOST_CHECK( typeid(double) == testGroup.get_type_info("Double_Func") );
+ BOOST_CHECK( typeid(std::string) != testGroup.get_type_info("Double_Func") );
 }
 
-BOOST_AUTO_TEST_CASE( TestDouble2GetRange )
+BOOST_AUTO_TEST_CASE( TestInvalidSet )
 {
- TestPropertyGroup_5 testGroup;
+ TestGroup testGroup;
     
- const DoubleEditor *pEditor = dynamic_cast<const DoubleEditor*>(testGroup.get_metadata( PROPERTY_DOUBLE_2 ));
- BOOST_CHECK( pEditor->UseRange() == true );
+ BOOST_CHECK_THROW( testGroup.set_as_string( "Double_Func", "Foo" ), std::invalid_argument );
 }
-
-BOOST_AUTO_TEST_CASE( TestAutoGeneratedDesignerDouble )
-{
- TestAutoGeneratedDesigners testGroup;
-
- const Editor* pEditor = testGroup.get_metadata(PROPERTY_DOUBLE);
- BOOST_CHECK( NULL != dynamic_cast<const DoubleEditor*>(pEditor) );
-}
\ No newline at end of file

Copied: sandbox/pinhole/libs/pinhole/test/test_float_properties.cpp (from r41666, /sandbox/pinhole/libs/pinhole/test/TestFloatProperties.cpp)
==============================================================================
--- /sandbox/pinhole/libs/pinhole/test/TestFloatProperties.cpp (original)
+++ sandbox/pinhole/libs/pinhole/test/test_float_properties.cpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
@@ -8,94 +8,82 @@
 // For more information, see http://www.boost.org
 
 #define BOOST_TEST_MODULE PinholeLib
+
+#include <boost/pinhole/property_group.hpp>
+#include <boost/pinhole/property_manager.hpp>
 #include <boost/test/unit_test.hpp>
-#include "TestClassesAndConstants.h"
+
+using namespace std;
+using namespace boost;
+using namespace boost::pinhole;
+
+class TestGroup : public property_group
+{
+public:
+#if defined(BOOST_MSVC)
+ #pragma warning(push)
+ #pragma warning( disable: 4355 )
+#endif
+ TestGroup() : property_group( "PropertyGroupName", NULL )
+ {
+ m_float_Func = 1.1f;
+ m_float_Var = 1.1f;
+
+ add_property("Float_Func", "Float description", BOOST_SETTER(&TestGroup::SetFloat), BOOST_GETTER(&TestGroup::GetFloat), NULL );
+ add_property("Float_Var", "Float description", BOOST_SETTER_VAR(m_float_Var), BOOST_GETTER_VAR(m_float_Var), NULL );
+ }
+#if defined(BOOST_MSVC)
+ #pragma warning(pop)
+#endif
+
+ void SetFloat( float x ){ m_float_Func = x; }
+ float GetFloat(){ return( m_float_Func ); }
+
+private:
+ float m_float_Func;
+ float m_float_Var;
+};
 
 // I can hide these two line if I don't do everything in headers
 boost::shared_ptr<property_manager> property_manager::m_instance(new property_manager);
 event_source* event_source::m_instance = 0;
 
-BOOST_AUTO_TEST_CASE( TestSetGetFloat )
+BOOST_AUTO_TEST_CASE( TestSetGetFloat_Func )
 {
- TestPropertyGroup testGroup;
-
- float fValue;
- testGroup.set_as_string( PROPERTY_FLOAT_1, PROPERTY_FLOAT_1_STRING_VALUE );
- BOOST_CHECK( from_string<float>(fValue, testGroup.get_as_string(PROPERTY_FLOAT_1), std::dec) );
- BOOST_CHECK_EQUAL( PROPERTY_FLOAT_1_VALUE, fValue );
-}
+ TestGroup testGroup;
 
-BOOST_AUTO_TEST_CASE( TestSetGetFloatVar )
-{
- TestPropertyGroup testGroup;
+ testGroup.set( "Float_Func", 2.2f );
+ BOOST_CHECK( 2.2f == testGroup.get<float>( "Float_Func") );
     
- float fValue;
- testGroup.set_as_string( PROPERTY_FLOAT_1_VAR, PROPERTY_FLOAT_1_STRING_VALUE );
- BOOST_CHECK( from_string<float>(fValue, testGroup.get_as_string(PROPERTY_FLOAT_1_VAR), std::dec) );
- BOOST_CHECK_EQUAL( PROPERTY_FLOAT_1_VALUE, fValue );
+ testGroup.set_as_string( "Float_Func", "3.3" );
+ BOOST_CHECK( "3.3" == testGroup.get_as_string( "Float_Func") );
 }
 
-BOOST_AUTO_TEST_CASE( TestFloatPropertyType )
+BOOST_AUTO_TEST_CASE( TestSetGetFloat_Var )
 {
- TestPropertyGroup_4 testGroup;
-
- BOOST_CHECK( typeid(bool) != testGroup.get_type_info(PROPERTY_FLOAT_1) );
- BOOST_CHECK( typeid(int) != testGroup.get_type_info(PROPERTY_FLOAT_1) );
- BOOST_CHECK( typeid(float) == testGroup.get_type_info(PROPERTY_FLOAT_1) );
- BOOST_CHECK( typeid(double) != testGroup.get_type_info(PROPERTY_FLOAT_1) );
- BOOST_CHECK( typeid(std::string) != testGroup.get_type_info(PROPERTY_FLOAT_1) );
-
- const FloatEditor *pEditor = dynamic_cast<const FloatEditor*>(testGroup.get_metadata( PROPERTY_FLOAT_1 ));
- BOOST_CHECK( pEditor != NULL );
- BOOST_CHECK( testGroup.get_metadata(PROPERTY_FLOAT_1)->getEditorPropertyType() == FloatType );
-}
+ TestGroup testGroup;
 
-BOOST_AUTO_TEST_CASE( TestFloatGetControlType )
-{
- TestPropertyGroup_4 testGroup;
+ testGroup.set( "Float_Var", 2.2f );
+ BOOST_CHECK( 2.2f == testGroup.get<float>( "Float_Var") );
     
- const FloatEditor *pEditor = dynamic_cast<const FloatEditor*>(testGroup.get_metadata( PROPERTY_FLOAT_1 ));
- BOOST_CHECK( pEditor->GetControlType() == EditBox );
+ testGroup.set_as_string( "Float_Var", "3.3" );
+ BOOST_CHECK( "3.3" == testGroup.get_as_string( "Float_Var") );
 }
 
-BOOST_AUTO_TEST_CASE( TestFloatGetUIOverrideType )
-{
- TestPropertyGroup_4 testGroup;
-
- const FloatEditor *pEditor = dynamic_cast<const FloatEditor*>(testGroup.get_metadata( PROPERTY_FLOAT_2 ));
- BOOST_CHECK( pEditor->GetControlType() == Tracker );
-}
-
-BOOST_AUTO_TEST_CASE( TestFloatHighLowIncrement )
-{
- TestPropertyGroup_4 testGroup;
-
- const FloatEditor *pEditor = dynamic_cast<const FloatEditor*>(testGroup.get_metadata( PROPERTY_FLOAT_2 ));
- BOOST_CHECK_EQUAL( FLOAT_LOW, pEditor->getLowRange() );
- BOOST_CHECK_EQUAL( FLOAT_HIGH, pEditor->getHighRange() );
- BOOST_CHECK_EQUAL( FLOAT_INCREMENT, pEditor->getIncrement() );
-}
-
-BOOST_AUTO_TEST_CASE( TestFloatGetRange )
+BOOST_AUTO_TEST_CASE( TestFloatPropertyType )
 {
- TestPropertyGroup_4 testGroup;
+ TestGroup testGroup;
     
- const FloatEditor *pEditor = dynamic_cast<const FloatEditor*>(testGroup.get_metadata( PROPERTY_FLOAT_2 ));
- BOOST_CHECK( pEditor->UseRange() == true );
+ BOOST_CHECK( typeid(bool) != testGroup.get_type_info("Float_Func") );
+ BOOST_CHECK( typeid(int) != testGroup.get_type_info("Float_Func") );
+ BOOST_CHECK( typeid(float) == testGroup.get_type_info("Float_Func") );
+ BOOST_CHECK( typeid(double) != testGroup.get_type_info("Float_Func") );
+ BOOST_CHECK( typeid(std::string) != testGroup.get_type_info("Float_Func") );
 }
 
-BOOST_AUTO_TEST_CASE( TestAutoGeneratedDesignerFloat )
+BOOST_AUTO_TEST_CASE( TestInvalidSet )
 {
- TestAutoGeneratedDesigners testGroup;
+ TestGroup testGroup;
     
- const Editor* pEditor = testGroup.get_metadata(PROPERTY_FLOAT_1);
- BOOST_CHECK( NULL != dynamic_cast<const FloatEditor*>(pEditor) );
+ BOOST_CHECK_THROW( testGroup.set_as_string( "Float_Func", "Foo" ), std::invalid_argument );
 }
-
-BOOST_AUTO_TEST_CASE( TestUpDownEditor)
-{
- TestUpDownGroup testGroup;
-
- const Editor* pEditor = testGroup.get_metadata(PROPERTY_FLOAT_1);
- BOOST_CHECK( pEditor->GetControlType() == UpDown );
-}
\ No newline at end of file

Copied: sandbox/pinhole/libs/pinhole/test/test_integer_properties.cpp (from r41666, /sandbox/pinhole/libs/pinhole/test/TestIntegerProperties.cpp)
==============================================================================
--- /sandbox/pinhole/libs/pinhole/test/TestIntegerProperties.cpp (original)
+++ sandbox/pinhole/libs/pinhole/test/test_integer_properties.cpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
@@ -8,94 +8,82 @@
 // For more information, see http://www.boost.org
 
 #define BOOST_TEST_MODULE PinholeLib
+
+#include <boost/pinhole/property_group.hpp>
+#include <boost/pinhole/property_manager.hpp>
 #include <boost/test/unit_test.hpp>
-#include "TestClassesAndConstants.h"
+
+using namespace std;
+using namespace boost;
+using namespace boost::pinhole;
 
 // I can hide these two line if I don't do everything in headers
 boost::shared_ptr<property_manager> property_manager::m_instance(new property_manager);
 event_source* event_source::m_instance = 0;
 
-BOOST_AUTO_TEST_CASE( TestIntegerSetGet )
+class TestGroup : public property_group
 {
- TestPropertyGroup testGroup;
-
- int iValue;
- testGroup.set_as_string( PROPERTY_INT_1, PROPERTY_INT_1_STRING_VALUE );
- BOOST_CHECK( from_string<int>(iValue, testGroup.get_as_string(PROPERTY_INT_1), std::dec) );
- BOOST_CHECK_EQUAL( iValue, PROPERTY_INT_1_VALUE );
-}
+public:
+#if defined(BOOST_MSVC)
+ #pragma warning(push)
+ #pragma warning( disable: 4355 )
+#endif
+ TestGroup() : property_group( "PropertyGroupName", NULL )
+ {
+ m_int_Func = 0;
+ m_int_Var = 0;
 
-BOOST_AUTO_TEST_CASE( TestIntegerSetGetVar )
-{
- TestPropertyGroup testGroup;
-
- int iValue;
- testGroup.set_as_string( PROPERTY_INT_1_VAR, PROPERTY_INT_1_STRING_VALUE );
- BOOST_CHECK( from_string<int>(iValue, testGroup.get_as_string(PROPERTY_INT_1_VAR), std::dec) );
- BOOST_CHECK_EQUAL( iValue, PROPERTY_INT_1_VALUE );
-}
+ add_property("Int_Func", "Int1 description", BOOST_SETTER(&TestGroup::SetInt), BOOST_GETTER(&TestGroup::GetInt), NULL );
+ add_property("Int_Var", "Int2 description", BOOST_SETTER_VAR(m_int_Var), BOOST_GETTER_VAR(m_int_Var), NULL );
+ }
+#if defined(BOOST_MSVC)
+ #pragma warning(pop)
+#endif
 
-BOOST_AUTO_TEST_CASE( TestIntegerEditorType )
-{
- TestPropertyGroup_4 testGroup;
-
- BOOST_CHECK( typeid(bool) != testGroup.get_type_info(PROPERTY_INT_1) );
- BOOST_CHECK( typeid(int) == testGroup.get_type_info(PROPERTY_INT_1) );
- BOOST_CHECK( typeid(float) != testGroup.get_type_info(PROPERTY_INT_1) );
- BOOST_CHECK( typeid(double) != testGroup.get_type_info(PROPERTY_INT_1) );
- BOOST_CHECK( typeid(std::string) != testGroup.get_type_info(PROPERTY_INT_1) );
-
- const IntegerEditor *pEditor = dynamic_cast<const IntegerEditor*>(testGroup.get_metadata( PROPERTY_INT_1 ));
- BOOST_CHECK( pEditor != NULL );
- BOOST_CHECK( testGroup.get_metadata(PROPERTY_INT_1)->getEditorPropertyType() == IntegerType );
-}
+ void SetInt( int x ){ m_int_Func = x; }
+ int GetInt(){ return( m_int_Func ); }
 
-BOOST_AUTO_TEST_CASE( TestIntegerHighLowIncrement )
-{
- TestPropertyGroup_4 testGroup;
-
- const IntegerEditor *pEditor = dynamic_cast<const IntegerEditor*>(testGroup.get_metadata( PROPERTY_INT_1 ));
- BOOST_CHECK_EQUAL( pEditor->getLowRange(), INT_LOW );
- BOOST_CHECK_EQUAL( pEditor->getHighRange(), INT_HIGH );
- BOOST_CHECK_EQUAL( pEditor->getIncrement(), INT_INCREMENT );
-}
+private:
+ int m_int_Func;
+ int m_int_Var;
+};
 
-BOOST_AUTO_TEST_CASE( TestIntegerGetControlType )
+BOOST_AUTO_TEST_CASE( TestIntegerSetGet_Func )
 {
- TestPropertyGroup_4 testGroup;
-
- const IntegerEditor *pEditor = dynamic_cast<const IntegerEditor*>(testGroup.get_metadata( PROPERTY_INT_1 ));
- BOOST_CHECK( pEditor->GetControlType() == DropDown );
- BOOST_CHECK( pEditor->UseRange() == true );
-}
+ TestGroup testGroup;
 
-BOOST_AUTO_TEST_CASE( TestInteger2GetRange )
-{
- TestPropertyGroup_4 testGroup;
+ testGroup.set( "Int_Func", 1 );
+ BOOST_CHECK( 1 == testGroup.get<int>( "Int_Func") );
     
- const IntegerEditor *pEditor = dynamic_cast<const IntegerEditor*>(testGroup.get_metadata( PROPERTY_INT_2 ));
- BOOST_CHECK( pEditor->UseRange() == false );
+ testGroup.set_as_string( "Int_Func", "2" );
+ BOOST_CHECK( "2" == testGroup.get_as_string( "Int_Func") );
 }
 
-BOOST_AUTO_TEST_CASE( TestInteger2GetControlType )
+BOOST_AUTO_TEST_CASE( TestIntegerSetGet_Var )
 {
- TestPropertyGroup_4 testGroup;
+ TestGroup testGroup;
+
+ testGroup.set( "Int_Var", 1 );
+ BOOST_CHECK( 1 == testGroup.get<int>( "Int_Var") );
     
- const IntegerEditor *pEditor = dynamic_cast<const IntegerEditor*>(testGroup.get_metadata( PROPERTY_INT_2 ));
- BOOST_CHECK( pEditor->GetControlType() == EditBox );
+ testGroup.set_as_string( "Int_Var", "2" );
+ BOOST_CHECK( "2" == testGroup.get_as_string( "Int_Var") );
 }
 
-BOOST_AUTO_TEST_CASE( TestIntegerGetEditorTypeFailure )
+BOOST_AUTO_TEST_CASE( TestIntegerEditorType )
 {
- TestPropertyGroup_5 testGroup;
+ TestGroup testGroup;
     
- BOOST_CHECK_THROW( testGroup.get_metadata( PROPERTY_INT_1 ), no_metadata_defined_error );
+ BOOST_CHECK( typeid(bool) != testGroup.get_type_info("Int_Func") );
+ BOOST_CHECK( typeid(int) == testGroup.get_type_info("Int_Func") );
+ BOOST_CHECK( typeid(float) != testGroup.get_type_info("Int_Func") );
+ BOOST_CHECK( typeid(double) != testGroup.get_type_info("Int_Func") );
+ BOOST_CHECK( typeid(std::string) != testGroup.get_type_info("Int_Func") );
 }
 
-BOOST_AUTO_TEST_CASE( TestAutoGeneratedDesignerInt )
+BOOST_AUTO_TEST_CASE( TestInvalidSet )
 {
- TestAutoGeneratedDesigners testGroup;
+ TestGroup testGroup;
     
- const Editor* pEditor = testGroup.get_metadata(PROPERTY_INT_1);
- BOOST_CHECK( NULL != dynamic_cast<const IntegerEditor*>(pEditor) );
-}
\ No newline at end of file
+ BOOST_CHECK_THROW( testGroup.set_as_string( "Int_Func", "Foo" ), std::invalid_argument );
+}

Copied: sandbox/pinhole/libs/pinhole/test/test_property_group_wrapper.cpp (from r41666, /sandbox/pinhole/libs/pinhole/test/TestPropertyGroupWrapper.cpp)
==============================================================================
--- /sandbox/pinhole/libs/pinhole/test/TestPropertyGroupWrapper.cpp (original)
+++ sandbox/pinhole/libs/pinhole/test/test_property_group_wrapper.cpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
@@ -9,8 +9,8 @@
 
 #define BOOST_TEST_MODULE PinholeLib
 #include <boost/test/unit_test.hpp>
-#include "TestClassesAndConstants.h"
-#include <boost/pinhole/property_group_wrapper.h>
+#include "TestClassesAndConstants.hpp"
+#include <boost/pinhole/property_group_wrapper.hpp>
 
 // I can hide these two line if I don't do everything in headers
 boost::shared_ptr<property_manager> property_manager::m_instance(new property_manager);

Copied: sandbox/pinhole/libs/pinhole/test/test_property_groups.cpp (from r41666, /sandbox/pinhole/libs/pinhole/test/TestPropertyGroups.cpp)
==============================================================================
--- /sandbox/pinhole/libs/pinhole/test/TestPropertyGroups.cpp (original)
+++ sandbox/pinhole/libs/pinhole/test/test_property_groups.cpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
@@ -9,8 +9,8 @@
 
 #define BOOST_TEST_MODULE PinholeLib
 #include <boost/test/unit_test.hpp>
-#include "TestClassesAndConstants.h"
-#include <boost/pinhole/find.h>
+#include "TestClassesAndConstants.hpp"
+#include <boost/pinhole/find.hpp>
 
 // I can hide these two line if I don't do everything in headers
 boost::shared_ptr<property_manager> property_manager::m_instance(new property_manager);

Copied: sandbox/pinhole/libs/pinhole/test/test_string_properties.cpp (from r41666, /sandbox/pinhole/libs/pinhole/test/TestStringProperties.cpp)
==============================================================================
--- /sandbox/pinhole/libs/pinhole/test/TestStringProperties.cpp (original)
+++ sandbox/pinhole/libs/pinhole/test/test_string_properties.cpp 2007-12-03 19:01:44 EST (Mon, 03 Dec 2007)
@@ -8,77 +8,72 @@
 // For more information, see http://www.boost.org
 
 #define BOOST_TEST_MODULE PinholeLib
+
+#include <boost/pinhole/property_group.hpp>
+#include <boost/pinhole/property_manager.hpp>
 #include <boost/test/unit_test.hpp>
-#include "TestClassesAndConstants.h"
+
+using namespace std;
+using namespace boost;
+using namespace boost::pinhole;
 
 // I can hide these two line if I don't do everything in headers
 boost::shared_ptr<property_manager> property_manager::m_instance(new property_manager);
 event_source* event_source::m_instance = 0;
 
-BOOST_AUTO_TEST_CASE( TestGetString )
+class TestGroup : public property_group
 {
- TestPropertyGroup testGroup;
-
- BOOST_CHECK( testGroup.get_as_string(PROPERTY_STRING_1) == PROPERTY_STRING_1_VALUE );
-}
+public:
+#if defined(BOOST_MSVC)
+ #pragma warning(push)
+ #pragma warning( disable: 4355 )
+#endif
+ TestGroup() : property_group( "PropertyGroupName", NULL )
+ {
+ add_property("String_Func", "String1 description", BOOST_SETTER(&TestGroup::SetString), BOOST_GETTER(&TestGroup::GetString), NULL );
+ add_property("String_Var", "String2 description", BOOST_SETTER_VAR(m_string_Var), BOOST_GETTER_VAR(m_string_Var), NULL );
+ }
+#if defined(BOOST_MSVC)
+ #pragma warning(pop)
+#endif
 
-BOOST_AUTO_TEST_CASE( TestNoSetterReadOnly )
-{
- TestPropertyGroup testGroup;
-
- BOOST_CHECK_EQUAL( testGroup.is_read_only(PROPERTY_STRING_1), true );
-}
+ void SetString( string x ){ m_string_Func = x; }
+ string GetString(){ return( m_string_Func ); }
 
-BOOST_AUTO_TEST_CASE( TestNoSetterStringFail )
-{
- TestPropertyGroup testGroup;
-
- BOOST_CHECK_THROW( testGroup.set_as_string(PROPERTY_STRING_1, PROPERTY_STRING_1_VALUE), boost::bad_function_call );
-}
+private:
+ string m_string_Func;
+ string m_string_Var;
+};
 
-BOOST_AUTO_TEST_CASE( TestSetGetString )
+BOOST_AUTO_TEST_CASE( TestGetSetString_Func )
 {
- TestPropertyGroup testGroup;
-
- testGroup.set_as_string( PROPERTY_STRING_2, PROPERTY_STRING_2_VALUE );
- BOOST_CHECK( PROPERTY_STRING_2_VALUE == testGroup.get_as_string( PROPERTY_STRING_2) );
-}
+ TestGroup testGroup;
 
-BOOST_AUTO_TEST_CASE( TestSetGetStringVar )
-{
- TestPropertyGroup testGroup;
+ testGroup.set( "String_Func", string("first") );
+ BOOST_CHECK( testGroup.get<string>("String_Func") == "first" );
     
- testGroup.set_as_string( PROPERTY_STRING_2_VAR, PROPERTY_STRING_2_VALUE );
- BOOST_CHECK_EQUAL( testGroup.get_as_string( PROPERTY_STRING_2_VAR), PROPERTY_STRING_2_VALUE );
+ testGroup.set_as_string( "String_Func", "second" );
+ BOOST_CHECK( testGroup.get_as_string("String_Func") == "second" );
 }
 
-BOOST_AUTO_TEST_CASE( TestStringPropertyType )
+BOOST_AUTO_TEST_CASE( TestGetSetString_Var )
 {
- TestPropertyGroup_4 testGroup;
-
- BOOST_CHECK( typeid(bool) != testGroup.get_type_info(PROPERTY_STRING_2) );
- BOOST_CHECK( typeid(int) != testGroup.get_type_info(PROPERTY_STRING_2) );
- BOOST_CHECK( typeid(float) != testGroup.get_type_info(PROPERTY_STRING_2) );
- BOOST_CHECK( typeid(double) != testGroup.get_type_info(PROPERTY_STRING_2) );
- BOOST_CHECK( typeid(std::string) == testGroup.get_type_info(PROPERTY_STRING_2) );
-
- const StringEditor *pEditor = dynamic_cast<const StringEditor*>(testGroup.get_metadata( PROPERTY_STRING_2 ));
- BOOST_CHECK( pEditor != NULL );
- BOOST_CHECK( testGroup.get_metadata(PROPERTY_STRING_2)->getEditorPropertyType() == StringType );
-}
+ TestGroup testGroup;
 
-BOOST_AUTO_TEST_CASE( TestStringGetControlType )
-{
- TestPropertyGroup_4 testGroup;
+ testGroup.set( "String_Var", string("first") );
+ BOOST_CHECK( testGroup.get<string>("String_Var") == "first" );
     
- const StringEditor *pEditor = dynamic_cast<const StringEditor*>(testGroup.get_metadata( PROPERTY_STRING_2 ));
- BOOST_CHECK( pEditor->GetControlType() == EditBox );
+ testGroup.set_as_string( "String_Var", "second" );
+ BOOST_CHECK( testGroup.get_as_string("String_Var") == "second" );
 }
 
-BOOST_AUTO_TEST_CASE( TestAutoGeneratedDesignerString )
+BOOST_AUTO_TEST_CASE( TestStringPropertyType )
 {
- TestAutoGeneratedDesigners testGroup;
+ TestGroup testGroup;
     
- const Editor* pEditor = testGroup.get_metadata(PROPERTY_STRING_1);
- BOOST_CHECK( NULL != dynamic_cast<const StringEditor*>(pEditor) );
-}
+ BOOST_CHECK( typeid(bool) != testGroup.get_type_info("String_Func") );
+ BOOST_CHECK( typeid(int) != testGroup.get_type_info("String_Func") );
+ BOOST_CHECK( typeid(float) != testGroup.get_type_info("String_Func") );
+ BOOST_CHECK( typeid(double) != testGroup.get_type_info("String_Func") );
+ BOOST_CHECK( typeid(std::string) == testGroup.get_type_info("String_Func") );
+}
\ No newline at end of file


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk