Commit 11c55bfe authored by Nicolas Philipps's avatar Nicolas Philipps
Browse files

Added typedefs on BufferManager & BufferObject internal types

--HG--
branch : fw4spl_0.9.2
parent 389d9046
......@@ -670,7 +670,7 @@ void DumpEditor::changeStatus( int index )
{
SLM_TRACE_FUNC();
void** selectedBuffer = m_objectsUID[index];
::fwTools::IBufferManager::BufferPtrType selectedBuffer = m_objectsUID[index];
::fwTools::IBufferManager::sptr manager = ::fwTools::IBufferManager::getCurrent();
::fwMemory::BufferManager::sptr buffManager = ::fwMemory::BufferManager::dynamicCast(manager);
if(buffManager)
......
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2012.
* FW4SPL - Copyright (C) IRCAD, 2009-2013.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
......@@ -21,7 +21,7 @@ namespace fwMemory
struct FWMEMORY_CLASS_API BufferInfo
{
typedef std::map< void **, BufferInfo > MapType;
typedef std::map< ::fwTools::IBufferManager::BufferPtrType , BufferInfo > MapType;
typedef ::fwTools::IBufferManager::SizeType SizeType;
......
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2012.
* FW4SPL - Copyright (C) IRCAD, 2009-2013.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
......@@ -49,18 +49,22 @@ public:
* @name implementation of ::fwTools::IBufferManager hooks
* @{ */
FWMEMORY_API virtual bool registerBuffer(void ** buffer, IBufferManager::LockCountFunctionType lockCount);
FWMEMORY_API virtual bool unregisterBuffer(void ** buffer);
FWMEMORY_API virtual bool registerBuffer(::fwTools::IBufferManager::BufferPtrType buffer,
IBufferManager::LockCountFunctionType lockCount);
FWMEMORY_API virtual bool unregisterBuffer(::fwTools::IBufferManager::BufferPtrType buffer);
FWMEMORY_API virtual bool allocateBuffer(void ** buffer, SizeType size, ::fwTools::BufferAllocationPolicy::sptr policy);
FWMEMORY_API virtual bool setBuffer(void ** buffer, SizeType size, ::fwTools::BufferAllocationPolicy::sptr policy);
FWMEMORY_API virtual bool reallocateBuffer(void ** buffer, SizeType newSize);
FWMEMORY_API virtual bool destroyBuffer(void ** buffer);
FWMEMORY_API virtual bool allocateBuffer(::fwTools::IBufferManager::BufferPtrType buffer, SizeType size,
::fwTools::BufferAllocationPolicy::sptr policy);
FWMEMORY_API virtual bool setBuffer(::fwTools::IBufferManager::BufferPtrType buffer, SizeType size,
::fwTools::BufferAllocationPolicy::sptr policy);
FWMEMORY_API virtual bool reallocateBuffer(::fwTools::IBufferManager::BufferPtrType buffer, SizeType newSize);
FWMEMORY_API virtual bool destroyBuffer(::fwTools::IBufferManager::BufferPtrType buffer);
FWMEMORY_API virtual bool swapBuffer(void ** bufA, void ** bufB);
FWMEMORY_API virtual bool swapBuffer(::fwTools::IBufferManager::BufferPtrType bufA,
::fwTools::IBufferManager::BufferPtrType bufB);
FWMEMORY_API virtual bool lockBuffer(const void * const * buffer);
FWMEMORY_API virtual bool unlockBuffer(const void * const * buffer);
FWMEMORY_API virtual bool lockBuffer(::fwTools::IBufferManager::ConstBufferPtrType buffer);
FWMEMORY_API virtual bool unlockBuffer(::fwTools::IBufferManager::ConstBufferPtrType buffer);
/** @} */
......@@ -76,8 +80,8 @@ public:
*
* @return true on success
* @{ */
FWMEMORY_API bool dumpBuffer(const void * const * buffer);
FWMEMORY_API bool restoreBuffer(const void * const * buffer);
FWMEMORY_API bool dumpBuffer(::fwTools::IBufferManager::ConstBufferPtrType buffer);
FWMEMORY_API bool restoreBuffer(::fwTools::IBufferManager::ConstBufferPtrType buffer);
/** @} */
/**
......@@ -91,8 +95,10 @@ public:
*
* @return true on success
* @{ */
FWMEMORY_API bool writeBuffer(const void * buffer, SizeType size, ::boost::filesystem::path &path);
FWMEMORY_API bool readBuffer(void * buffer, SizeType size, ::boost::filesystem::path &path);
FWMEMORY_API bool writeBuffer(::fwTools::IBufferManager::ConstBufferType buffer, SizeType size,
::boost::filesystem::path &path);
FWMEMORY_API bool readBuffer(::fwTools::IBufferManager::BufferType buffer, SizeType size,
::boost::filesystem::path &path);
/** @} */
......@@ -138,12 +144,13 @@ public:
/**
* @brief Returns true if 'buffer' is dumped
*/
FWMEMORY_API bool isDumped(const void * const * const buffer) const;
FWMEMORY_API bool isDumped(const ::fwTools::IBufferManager::ConstBufferPtrType buffer) const;
/**
* @brief Returns the path of the file containing the dumped buffer
*/
FWMEMORY_API ::boost::filesystem::path getDumpedFilePath(const void * const * const buffer) const;
FWMEMORY_API ::boost::filesystem::path
getDumpedFilePath(const ::fwTools::IBufferManager::ConstBufferPtrType buffer) const;
protected:
......@@ -155,8 +162,9 @@ protected:
*
* Used by public dump/restoreBuffer methods
* @{ */
FWMEMORY_API bool dumpBuffer(BufferInfo & info, void ** buffer);
FWMEMORY_API bool restoreBuffer(BufferInfo & info, void ** buffer, SizeType size = 0);
FWMEMORY_API bool dumpBuffer(BufferInfo & info, ::fwTools::IBufferManager::BufferPtrType buffer);
FWMEMORY_API bool restoreBuffer(BufferInfo & info, ::fwTools::IBufferManager::BufferPtrType buffer,
SizeType size = 0);
/** @} */
......
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2012.
* FW4SPL - Copyright (C) IRCAD, 2009-2013.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
......@@ -33,15 +33,15 @@ public :
typedef boost::function< IPolicy::sptr () > PolicyFactoryType;
typedef std::map<std::string, PolicyFactoryType> FactoryMap;
virtual void allocationRequest( BufferInfo &info, void **buffer, BufferInfo::SizeType size ) = 0 ;
virtual void setRequest( BufferInfo &info, void **buffer, BufferInfo::SizeType size ) = 0 ;
virtual void reallocateRequest( BufferInfo &info, void **buffer, BufferInfo::SizeType newSize ) = 0 ;
virtual void destroyRequest( BufferInfo &info, void **buffer ) = 0 ;
virtual void lockRequest( BufferInfo &info, void **buffer ) = 0 ;
virtual void unlockRequest( BufferInfo &info, void **buffer ) = 0 ;
virtual void allocationRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer, BufferInfo::SizeType size ) = 0 ;
virtual void setRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer, BufferInfo::SizeType size ) = 0 ;
virtual void reallocateRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer, BufferInfo::SizeType newSize ) = 0 ;
virtual void destroyRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer ) = 0 ;
virtual void lockRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer ) = 0 ;
virtual void unlockRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer ) = 0 ;
virtual void dumpSuccess( BufferInfo &info, void **buffer ) = 0 ;
virtual void restoreSuccess( BufferInfo &info, void **buffer ) = 0 ;
virtual void dumpSuccess( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer ) = 0 ;
virtual void restoreSuccess( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer ) = 0 ;
virtual void setManager(::fwTools::IBufferManager::sptr manager) = 0;
......
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2012.
* FW4SPL - Copyright (C) IRCAD, 2009-2013.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
......@@ -32,15 +32,15 @@ class FWMEMORY_CLASS_API AlwaysDump : public fwMemory::IPolicy
public :
fwCoreClassDefinitionsWithFactoryMacro((AlwaysDump)(fwMemory::IPolicy), (()), new AlwaysDump );
FWMEMORY_API virtual void allocationRequest( BufferInfo &info, void **buffer, BufferInfo::SizeType size ) ;
FWMEMORY_API virtual void setRequest( BufferInfo &info, void **buffer, BufferInfo::SizeType size ) ;
FWMEMORY_API virtual void reallocateRequest( BufferInfo &info, void **buffer, BufferInfo::SizeType newSize ) ;
FWMEMORY_API virtual void destroyRequest( BufferInfo &info, void **buffer ) ;
FWMEMORY_API virtual void lockRequest( BufferInfo &info, void **buffer ) ;
FWMEMORY_API virtual void unlockRequest( BufferInfo &info, void **buffer ) ;
FWMEMORY_API virtual void allocationRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer, BufferInfo::SizeType size ) ;
FWMEMORY_API virtual void setRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer, BufferInfo::SizeType size ) ;
FWMEMORY_API virtual void reallocateRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer, BufferInfo::SizeType newSize ) ;
FWMEMORY_API virtual void destroyRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer ) ;
FWMEMORY_API virtual void lockRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer ) ;
FWMEMORY_API virtual void unlockRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer ) ;
FWMEMORY_API virtual void dumpSuccess( BufferInfo &info, void **buffer );
FWMEMORY_API virtual void restoreSuccess( BufferInfo &info, void **buffer );
FWMEMORY_API virtual void dumpSuccess( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer );
FWMEMORY_API virtual void restoreSuccess( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer );
FWMEMORY_API virtual void setManager(::fwTools::IBufferManager::sptr manager);
......
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2012.
* FW4SPL - Copyright (C) IRCAD, 2009-2013.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
......@@ -35,15 +35,15 @@ public :
FWMEMORY_API BarrierDump();
FWMEMORY_API virtual void allocationRequest( BufferInfo &info, void **buffer, BufferInfo::SizeType size ) ;
FWMEMORY_API virtual void setRequest( BufferInfo &info, void **buffer, BufferInfo::SizeType size ) ;
FWMEMORY_API virtual void reallocateRequest( BufferInfo &info, void **buffer, BufferInfo::SizeType newSize ) ;
FWMEMORY_API virtual void destroyRequest( BufferInfo &info, void **buffer ) ;
FWMEMORY_API virtual void lockRequest( BufferInfo &info, void **buffer ) ;
FWMEMORY_API virtual void unlockRequest( BufferInfo &info, void **buffer ) ;
FWMEMORY_API virtual void allocationRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer, BufferInfo::SizeType size ) ;
FWMEMORY_API virtual void setRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer, BufferInfo::SizeType size ) ;
FWMEMORY_API virtual void reallocateRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer, BufferInfo::SizeType newSize ) ;
FWMEMORY_API virtual void destroyRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer ) ;
FWMEMORY_API virtual void lockRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer ) ;
FWMEMORY_API virtual void unlockRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer ) ;
FWMEMORY_API virtual void dumpSuccess( BufferInfo &info, void **buffer );
FWMEMORY_API virtual void restoreSuccess( BufferInfo &info, void **buffer );
FWMEMORY_API virtual void dumpSuccess( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer );
FWMEMORY_API virtual void restoreSuccess( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer );
FWMEMORY_API void setManager(::fwTools::IBufferManager::sptr manager);
......
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2012.
* FW4SPL - Copyright (C) IRCAD, 2009-2013.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
......@@ -34,15 +34,15 @@ public :
fwCoreClassDefinitionsWithFactoryMacro((NeverDump)(fwMemory::IPolicy), (()), new NeverDump );
FWMEMORY_API virtual void allocationRequest( BufferInfo &info, void **buffer, BufferInfo::SizeType size ) ;
FWMEMORY_API virtual void setRequest( BufferInfo &info, void **buffer, BufferInfo::SizeType size ) ;
FWMEMORY_API virtual void reallocateRequest( BufferInfo &info, void **buffer, BufferInfo::SizeType newSize ) ;
FWMEMORY_API virtual void destroyRequest( BufferInfo &info, void **buffer ) ;
FWMEMORY_API virtual void lockRequest( BufferInfo &info, void **buffer ) ;
FWMEMORY_API virtual void unlockRequest( BufferInfo &info, void **buffer ) ;
FWMEMORY_API virtual void allocationRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer, BufferInfo::SizeType size ) ;
FWMEMORY_API virtual void setRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer, BufferInfo::SizeType size ) ;
FWMEMORY_API virtual void reallocateRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer, BufferInfo::SizeType newSize ) ;
FWMEMORY_API virtual void destroyRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer ) ;
FWMEMORY_API virtual void lockRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer ) ;
FWMEMORY_API virtual void unlockRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer ) ;
FWMEMORY_API virtual void dumpSuccess( BufferInfo &info, void **buffer );
FWMEMORY_API virtual void restoreSuccess( BufferInfo &info, void **buffer );
FWMEMORY_API virtual void dumpSuccess( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer );
FWMEMORY_API virtual void restoreSuccess( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer );
FWMEMORY_API void setManager(::fwTools::IBufferManager::sptr manager);
......
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2012.
* FW4SPL - Copyright (C) IRCAD, 2009-2013.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
......@@ -40,15 +40,15 @@ public :
FWMEMORY_API ValveDump();
FWMEMORY_API virtual void allocationRequest( BufferInfo &info, void **buffer, BufferInfo::SizeType size ) ;
FWMEMORY_API virtual void setRequest( BufferInfo &info, void **buffer, BufferInfo::SizeType size ) ;
FWMEMORY_API virtual void reallocateRequest( BufferInfo &info, void **buffer, BufferInfo::SizeType newSize ) ;
FWMEMORY_API virtual void destroyRequest( BufferInfo &info, void **buffer ) ;
FWMEMORY_API virtual void lockRequest( BufferInfo &info, void **buffer ) ;
FWMEMORY_API virtual void unlockRequest( BufferInfo &info, void **buffer ) ;
FWMEMORY_API virtual void allocationRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer, BufferInfo::SizeType size ) ;
FWMEMORY_API virtual void setRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer, BufferInfo::SizeType size ) ;
FWMEMORY_API virtual void reallocateRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer, BufferInfo::SizeType newSize ) ;
FWMEMORY_API virtual void destroyRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer ) ;
FWMEMORY_API virtual void lockRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer ) ;
FWMEMORY_API virtual void unlockRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer ) ;
FWMEMORY_API virtual void dumpSuccess( BufferInfo &info, void **buffer );
FWMEMORY_API virtual void restoreSuccess( BufferInfo &info, void **buffer );
FWMEMORY_API virtual void dumpSuccess( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer );
FWMEMORY_API virtual void restoreSuccess( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer );
FWMEMORY_API void setManager(::fwTools::IBufferManager::sptr manager);
......
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2012.
* FW4SPL - Copyright (C) IRCAD, 2009-2013.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
......@@ -36,7 +36,7 @@ BufferManager::~BufferManager()
//-----------------------------------------------------------------------------
bool BufferManager::registerBuffer(void ** buffer, IBufferManager::LockCountFunctionType lockCount)
bool BufferManager::registerBuffer(::fwTools::IBufferManager::BufferPtrType buffer, IBufferManager::LockCountFunctionType lockCount)
{
SLM_TRACE_FUNC();
BufferInfo & info = m_bufferInfos[buffer];
......@@ -47,7 +47,7 @@ bool BufferManager::registerBuffer(void ** buffer, IBufferManager::LockCountFunc
//-----------------------------------------------------------------------------
bool BufferManager::unregisterBuffer(void ** buffer)
bool BufferManager::unregisterBuffer(::fwTools::IBufferManager::BufferPtrType buffer)
{
SLM_TRACE_FUNC();
......@@ -67,7 +67,7 @@ bool BufferManager::unregisterBuffer(void ** buffer)
//-----------------------------------------------------------------------------
bool BufferManager::allocateBuffer(void ** buffer, SizeType size, ::fwTools::BufferAllocationPolicy::sptr policy)
bool BufferManager::allocateBuffer(::fwTools::IBufferManager::BufferPtrType buffer, SizeType size, ::fwTools::BufferAllocationPolicy::sptr policy)
{
SLM_TRACE_FUNC();
BufferInfo & info = m_bufferInfos[buffer];
......@@ -94,7 +94,7 @@ bool BufferManager::allocateBuffer(void ** buffer, SizeType size, ::fwTools::Buf
//-----------------------------------------------------------------------------
bool BufferManager::setBuffer(void ** buffer, SizeType size, ::fwTools::BufferAllocationPolicy::sptr policy)
bool BufferManager::setBuffer(::fwTools::IBufferManager::BufferPtrType buffer, SizeType size, ::fwTools::BufferAllocationPolicy::sptr policy)
{
SLM_TRACE_FUNC();
BufferInfo & info = m_bufferInfos[buffer];
......@@ -121,7 +121,7 @@ bool BufferManager::setBuffer(void ** buffer, SizeType size, ::fwTools::BufferAl
//-----------------------------------------------------------------------------
bool BufferManager::reallocateBuffer(void ** buffer, SizeType newSize)
bool BufferManager::reallocateBuffer(::fwTools::IBufferManager::BufferPtrType buffer, SizeType newSize)
{
SLM_TRACE_FUNC();
......@@ -144,7 +144,7 @@ bool BufferManager::reallocateBuffer(void ** buffer, SizeType newSize)
//-----------------------------------------------------------------------------
bool BufferManager::destroyBuffer(void ** buffer)
bool BufferManager::destroyBuffer(::fwTools::IBufferManager::BufferPtrType buffer)
{
SLM_TRACE_FUNC();
BufferInfo & info = m_bufferInfos[buffer];
......@@ -170,7 +170,7 @@ bool BufferManager::destroyBuffer(void ** buffer)
//-----------------------------------------------------------------------------
bool BufferManager::swapBuffer(void ** bufA, void ** bufB)
bool BufferManager::swapBuffer(::fwTools::IBufferManager::BufferPtrType bufA, ::fwTools::IBufferManager::BufferPtrType bufB)
{
SLM_TRACE_FUNC();
BufferInfo & infoA = m_bufferInfos[bufA];
......@@ -187,11 +187,11 @@ bool BufferManager::swapBuffer(void ** bufA, void ** bufB)
}
//-----------------------------------------------------------------------------
bool BufferManager::lockBuffer(const void * const * buffer)
bool BufferManager::lockBuffer(::fwTools::IBufferManager::ConstBufferPtrType buffer)
{
SLM_TRACE_FUNC();
void **castedBuffer = const_cast<void **>(buffer);
::fwTools::IBufferManager::BufferPtrType castedBuffer = const_cast< ::fwTools::IBufferManager::BufferPtrType >(buffer);
BufferInfo & info = m_bufferInfos[castedBuffer];
m_dumpPolicy->lockRequest( info, castedBuffer );
......@@ -211,11 +211,11 @@ bool BufferManager::lockBuffer(const void * const * buffer)
//-----------------------------------------------------------------------------
bool BufferManager::unlockBuffer(const void * const * buffer)
bool BufferManager::unlockBuffer(::fwTools::IBufferManager::ConstBufferPtrType buffer)
{
SLM_TRACE_FUNC();
void **castedBuffer = const_cast<void **>(buffer);
::fwTools::IBufferManager::BufferPtrType castedBuffer = const_cast< ::fwTools::IBufferManager::BufferPtrType >(buffer);
BufferInfo & info = m_bufferInfos[castedBuffer];
m_dumpPolicy->unlockRequest( info, castedBuffer );
......@@ -226,10 +226,10 @@ bool BufferManager::unlockBuffer(const void * const * buffer)
//-----------------------------------------------------------------------------
bool BufferManager::dumpBuffer(const void * const * buffer)
bool BufferManager::dumpBuffer(::fwTools::IBufferManager::ConstBufferPtrType buffer)
{
void **castedBuffer = const_cast<void **>(buffer);
::fwTools::IBufferManager::BufferPtrType castedBuffer = const_cast< ::fwTools::IBufferManager::BufferPtrType >(buffer);
BufferInfo & info = m_bufferInfos[castedBuffer];
return this->dumpBuffer(info, castedBuffer);
......@@ -238,7 +238,7 @@ bool BufferManager::dumpBuffer(const void * const * buffer)
//-----------------------------------------------------------------------------
bool BufferManager::dumpBuffer(BufferManager::BufferInfo & info, void ** buffer)
bool BufferManager::dumpBuffer(BufferManager::BufferInfo & info, ::fwTools::IBufferManager::BufferPtrType buffer)
{
SLM_TRACE_FUNC();
if ( info.isDumped || info.lockCount() > 0 || info.size == 0 )
......@@ -267,9 +267,9 @@ bool BufferManager::dumpBuffer(BufferManager::BufferInfo & info, void ** buffer)
//-----------------------------------------------------------------------------
bool BufferManager::restoreBuffer(const void * const * buffer)
bool BufferManager::restoreBuffer(::fwTools::IBufferManager::ConstBufferPtrType buffer)
{
void **castedBuffer = const_cast<void **>(buffer);
::fwTools::IBufferManager::BufferPtrType castedBuffer = const_cast< ::fwTools::IBufferManager::BufferPtrType >(buffer);
BufferInfo & info = m_bufferInfos[castedBuffer];
return this->restoreBuffer(info, castedBuffer);
......@@ -278,7 +278,7 @@ bool BufferManager::restoreBuffer(const void * const * buffer)
//-----------------------------------------------------------------------------
bool BufferManager::restoreBuffer(BufferManager::BufferInfo & info, void ** buffer, BufferManager::SizeType allocSize)
bool BufferManager::restoreBuffer(BufferManager::BufferInfo & info, ::fwTools::IBufferManager::BufferPtrType buffer, BufferManager::SizeType allocSize)
{
SLM_TRACE_FUNC();
......@@ -308,7 +308,7 @@ bool BufferManager::restoreBuffer(BufferManager::BufferInfo & info, void ** buff
//-----------------------------------------------------------------------------
bool BufferManager::writeBuffer(const void * buffer, SizeType size, ::boost::filesystem::path &path)
bool BufferManager::writeBuffer(::fwTools::IBufferManager::ConstBufferType buffer, SizeType size, ::boost::filesystem::path &path)
{
::boost::filesystem::ofstream fs(path, std::ios::binary|std::ios::trunc);
FW_RAISE_IF("Memory management : Unable to open " << path, !fs.good());
......@@ -321,7 +321,7 @@ bool BufferManager::writeBuffer(const void * buffer, SizeType size, ::boost::fil
//-----------------------------------------------------------------------------
bool BufferManager::readBuffer(void * buffer, SizeType size, ::boost::filesystem::path &path)
bool BufferManager::readBuffer(::fwTools::IBufferManager::BufferType buffer, SizeType size, ::boost::filesystem::path &path)
{
::boost::filesystem::ifstream fs(path, std::ios::in|std::ios::binary|std::ios::ate);
FW_RAISE_IF("Unable to read " << path, !fs.good());
......@@ -416,9 +416,9 @@ BufferManager::SizeType BufferManager::getManagedBufferSize() const
//-----------------------------------------------------------------------------
bool BufferManager::isDumped(const void * const * const buffer) const
bool BufferManager::isDumped(const ::fwTools::IBufferManager::ConstBufferPtrType buffer) const
{
void **castedBuffer = const_cast<void **>(buffer);
::fwTools::IBufferManager::BufferPtrType castedBuffer = const_cast< ::fwTools::IBufferManager::BufferPtrType >(buffer);
BufferInfoMapType::const_iterator iterInfo = m_bufferInfos.find(castedBuffer);
FW_RAISE_IF("Buffer is not managed by fwMemory::BufferManager.", iterInfo == m_bufferInfos.end() );
return iterInfo->second.isDumped;
......@@ -426,9 +426,9 @@ bool BufferManager::isDumped(const void * const * const buffer) const
//-----------------------------------------------------------------------------
::boost::filesystem::path BufferManager::getDumpedFilePath(const void * const * const buffer) const
::boost::filesystem::path BufferManager::getDumpedFilePath(const ::fwTools::IBufferManager::ConstBufferPtrType buffer) const
{
void **castedBuffer = const_cast<void **>(buffer);
::fwTools::IBufferManager::BufferPtrType castedBuffer = const_cast< ::fwTools::IBufferManager::BufferPtrType >(buffer);
BufferInfoMapType::const_iterator iterInfo = m_bufferInfos.find(castedBuffer);
FW_RAISE_IF("Buffer is not managed by fwMemory::BufferManager.", iterInfo == m_bufferInfos.end() );
return iterInfo->second.dumpedFile;
......
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2012.
* FW4SPL - Copyright (C) IRCAD, 2009-2013.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
......@@ -22,7 +22,7 @@ static IPolicy::Register<AlwaysDump> registerFactory(AlwaysDump::leafClassname()
//------------------------------------------------------------------------------
void AlwaysDump::allocationRequest( BufferInfo &info, void **buffer, BufferInfo::SizeType size )
void AlwaysDump::allocationRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer, BufferInfo::SizeType size )
{
this->apply();
}
......@@ -30,7 +30,7 @@ void AlwaysDump::allocationRequest( BufferInfo &info, void **buffer, BufferInfo:
//------------------------------------------------------------------------------
void AlwaysDump::setRequest( BufferInfo &info, void **buffer, BufferInfo::SizeType size )
void AlwaysDump::setRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer, BufferInfo::SizeType size )
{
this->apply();
}
......@@ -38,7 +38,7 @@ void AlwaysDump::setRequest( BufferInfo &info, void **buffer, BufferInfo::SizeTy
//------------------------------------------------------------------------------
void AlwaysDump::reallocateRequest( BufferInfo &info, void **buffer, BufferInfo::SizeType newSize )
void AlwaysDump::reallocateRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer, BufferInfo::SizeType newSize )
{
this->apply();
}
......@@ -46,7 +46,7 @@ void AlwaysDump::reallocateRequest( BufferInfo &info, void **buffer, BufferInfo:
//------------------------------------------------------------------------------
void AlwaysDump::destroyRequest( BufferInfo &info, void **buffer )
void AlwaysDump::destroyRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer )
{
this->apply();
}
......@@ -54,7 +54,7 @@ void AlwaysDump::destroyRequest( BufferInfo &info, void **buffer )
//------------------------------------------------------------------------------
void AlwaysDump::lockRequest( BufferInfo &info, void **buffer )
void AlwaysDump::lockRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer )
{
this->apply();
}
......@@ -62,7 +62,7 @@ void AlwaysDump::lockRequest( BufferInfo &info, void **buffer )
//------------------------------------------------------------------------------
void AlwaysDump::unlockRequest( BufferInfo &info, void **buffer )
void AlwaysDump::unlockRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer )
{
this->apply();
}
......@@ -70,14 +70,14 @@ void AlwaysDump::unlockRequest( BufferInfo &info, void **buffer )
//------------------------------------------------------------------------------
void AlwaysDump::dumpSuccess( BufferInfo &info, void **buffer )
void AlwaysDump::dumpSuccess( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer )
{
}
//------------------------------------------------------------------------------
void AlwaysDump::restoreSuccess( BufferInfo &info, void **buffer )
void AlwaysDump::restoreSuccess( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer )
{
}
......
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2012.
* FW4SPL - Copyright (C) IRCAD, 2009-2013.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
......@@ -33,7 +33,7 @@ BarrierDump::BarrierDump() :
//------------------------------------------------------------------------------
void BarrierDump::allocationRequest( BufferInfo &info, void **buffer, BufferInfo::SizeType size )
void BarrierDump::allocationRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer, BufferInfo::SizeType size )
{
m_totalAllocated -= info.size;
m_totalAllocated += size;
......@@ -47,7 +47,7 @@ void BarrierDump::allocationRequest( BufferInfo &info, void **buffer, BufferInfo
//------------------------------------------------------------------------------
void BarrierDump::setRequest( BufferInfo &info, void **buffer, BufferInfo::SizeType size )
void BarrierDump::setRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer, BufferInfo::SizeType size )
{
m_totalAllocated -= info.size;
m_totalAllocated += size;
......@@ -61,7 +61,7 @@ void BarrierDump::setRequest( BufferInfo &info, void **buffer, BufferInfo::SizeT
//------------------------------------------------------------------------------
void BarrierDump::reallocateRequest( BufferInfo &info, void **buffer, BufferInfo::SizeType newSize )
void BarrierDump::reallocateRequest( BufferInfo &info, ::fwTools::IBufferManager::BufferPtrType buffer, BufferInfo::SizeType newSize )