+// =========================================================================
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// =========================================================================
+#ifndef __cpPluginsBase__RawData__h__
+#define __cpPluginsBase__RawData__h__
+
+#include <cpPluginsBase_Export.h>
+#include <cpPlugins/DataObject.h>
+
+namespace cpPluginsBase
+{
+ /**
+ */
+ class CPPLUGINSBASE_EXPORT RawData
+ : public cpPlugins::DataObject
+ {
+ cpPluginsTypeMacro( RawData, cpPlugins::DataObject );
+ cpPluginsNewMacro( );
+
+ public:
+ typedef char TData;
+ typedef std::shared_ptr< TData > TDataPointer;
+
+ public:
+ template< class _TType >
+ void TakeOwnership( _TType* buffer, const std::size_t& size );
+
+ template< class _TType = char >
+ _TType* GetBuffer( );
+
+ template< class _TType = char >
+ const _TType* GetBuffer( ) const;
+
+ const std::size_t& GetSize( ) const;
+
+ virtual void Print( std::ostream& o ) const override;
+
+ protected:
+ RawData( );
+ virtual ~RawData( );
+
+ protected:
+ TDataPointer m_Data;
+ std::size_t m_Size;
+ };
+
+} // ecapseman
+
+// -------------------------------------------------------------------------
+template< class _TType >
+void cpPluginsBase::RawData::
+TakeOwnership( _TType* buffer, const std::size_t& size )
+{
+ this->m_Data = TDataPointer( reinterpret_cast< TData* >( buffer ) );
+ this->m_Size = size;
+ this->_SynchTime( );
+}
+
+// -------------------------------------------------------------------------
+template< class _TType >
+_TType* cpPluginsBase::RawData::
+GetBuffer( )
+{
+ return( reinterpret_cast< _TType* >( this->m_Data.get( ) ) );
+}
+
+// -------------------------------------------------------------------------
+template< class _TType >
+const _TType* cpPluginsBase::RawData::
+GetBuffer( ) const
+{
+ return( reinterpret_cast< const _TType* >( this->m_Data.get( ) ) );
+}
+
+#endif // __cpPluginsBase__RawData__h__
+
+// eof - $RCSfile$