RTFX  0.3
Real time special effects collaborative visualization and production library.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
RTFXPropertyString.h
Go to the documentation of this file.
1 #ifndef __RTFX_PROPERTY_STRING__
2 #define __RTFX_PROPERTY_STRING__
3 
4 
5 
6 #include "RTFXBoostIncludes.h"
7 
8 #include "RTFXMath.h"
9 #include "RTFXRecorder.h"
10 #include "RTFXHelpers.h"
11 
20 using namespace std;
21 
22 namespace RTFX
23 {
31  class RTFXAPI RTFXPropertyString : public RTFXProperty
32  {
33  public:
36  {
37  SetType( RTFXProperty::STRING );
38  value = "";
39  }
40 
43 
45  void SetValue( string _value )
46  {
47  boost::lock_guard<boost::mutex> lock( *dataLock );
48  value = _value;
49  SetChanged( true );
50  }
51 
53  string GetValue()
54  {
55  boost::lock_guard<boost::mutex> lock( *dataLock );
56  SetChanged( false );
57  return value;
58  }
59 
62  bool EqualTo( RTFXProperty * other )
63  {
64  // Check if Property types match (just in case)
65  if ( GetType() == other->GetType() )
66  {
67  if ( value.compare( (( RTFXPropertyString * )other)->value ) == 0 )
68  return true;
69  }
70  return false;
71  }
72 
74  void Copy( RTFXProperty * p )
75  {
76  SetID( p->GetID() );
77  SetName( p->GetName() );
78  SetDescription( p->GetDescription() );
79  SetOwner( p->GetOwner() );
80  SetChanged( p->GetChanged() );
81  SetType( p->GetType() );
82  SetDelete( p->GetDelete() );
83 
85  SetValue( ptr->GetValue() );
86  }
87 
88  private:
89 
91  string value;
92 
94  friend class boost::serialization::access;
95 
96  template<class Archive>
97  void serialize( Archive &ar, const unsigned int version )
98  {
99  ar & boost::serialization::base_object<RTFXProperty>( *this );
100  ar & value;
101  };
102  };
103 }
104 
105 BOOST_CLASS_EXPORT_KEY( RTFX::RTFXPropertyString )
106 
107 #endif