00001 #pragma once 00002 #ifndef PROPERTYCONTAINER_H 00003 #define PROPERTYCONTAINER_H 00004 00005 #include "Types.h" 00006 #include "AbstractPropertyContainer.h" 00007 #include "PointerProperty.h" 00008 00009 namespace RenderTools { 00010 00011 template< class T > 00012 class PropertyContainer : public AbstractPropertyContainer { 00013 public: 00014 00015 PropertyContainer( void ): 00016 AbstractPropertyContainer(){ 00017 } 00018 00019 virtual ~PropertyContainer( void ){ 00020 } 00021 00022 virtual void onInitialize( void ){ 00023 AbstractPropertyContainer::onInitialize(); 00024 } 00025 00026 virtual const PropertyPtr addProperty( const PropertyPtr & p, bool send ){ 00027 return( AbstractPropertyContainer::addProperty( p, send ) ); 00028 } 00029 00030 virtual const PropertyPtr addProperty( const string name, bool send ){ 00031 PropertyPtr p( new PointerProperty< T >( shared_ptr< T >() ) ); 00032 p->setName( name ); 00033 addProperty( p, send ); 00034 return( p ); 00035 } 00036 00037 virtual const shared_ptr< T > getItem( unsigned int i ) const { 00038 return( dynamic_pointer_cast< T, AbstractProperty >( getProperty( i ) ) ); 00039 } 00040 00041 protected: 00042 }; 00043 00044 }; // namespace RenderTools 00045 00046 00047 #endif
1.5.8