1 #ifndef __RTFX_PROPERTY_ARRAY__
2 #define __RTFX_PROPERTY_ARRAY__
9 #include "RTFXRecorder.h"
10 #include "RTFXHelpers.h"
39 SetType( RTFXProperty::BASICARRAY );
64 SetValue( ptr_->GetValue(), ptr_->GetLength() );
68 void SetValue( T * _value, RTFXBIGINT _length )
70 boost::lock_guard<boost::mutex> lock( *dataLock );
77 value = ( T * )malloc( _length *
sizeof( T ) );
80 memcpy( value, _value, _length *
sizeof( T ) );
89 void SetValue( T * _value, RTFXBIGINT _start, RTFXBIGINT _end )
91 boost::lock_guard<boost::mutex> lock( *dataLock );
98 newdata_ = ( T * )malloc( _end *
sizeof( T ) );
99 memcpy( newdata_, _value, length *
sizeof( T ) );
103 for ( RTFXBIGINT i = 0; i < _end - _start; i ++ )
105 value[_start+i] = _value[i];
114 boost::lock_guard<boost::mutex> lock( *dataLock );
122 T GetValueAt( RTFXBIGINT _index )
124 boost::lock_guard<boost::mutex> lock( *dataLock );
126 if ( _index >= length )
133 T v_ = value[ _index ];
140 void SetValueAt( T _value, RTFXBIGINT _index )
142 if ( _index >= length )
145 value[ _index ] = _value;
158 if ( GetType() == _other->
GetType() )
175 friend class boost::serialization::access;
177 template<
class Archive>
178 void save( Archive &_ar,
const unsigned int _version )
const
180 _ar << boost::serialization::base_object<RTFXProperty>( *this );
188 for (
unsigned int i = 0; i < length; i ++ )
196 template<
class Archive>
197 void load( Archive &_ar,
const unsigned int _version )
199 _ar >> boost::serialization::base_object<RTFXProperty>( *this );
208 value = ( T * ) malloc( length *
sizeof( T ) );
210 for (
unsigned int i = 0; i < length; i ++ )
214 template<
class Archive>
215 void serialize( Archive &_ar,
const unsigned int _version )
217 boost::serialization::split_member( _ar, (*
this), _version );
224 BOOST_CLASS_EXPORT_KEY( RTFX::RTFXPropertyArray<
int> )
225 BOOST_CLASS_EXPORT_KEY( RTFX::RTFXPropertyArray<
float> )
226 BOOST_CLASS_EXPORT_KEY( RTFX::RTFXPropertyArray<
double> )
227 BOOST_CLASS_EXPORT_KEY( RTFX::RTFXPropertyArray<
bool> )
228 BOOST_CLASS_EXPORT_KEY( RTFX::RTFXPropertyArray<
char> )