MyGUI_DataStreamHolder.h
Go to the documentation of this file.
/*
* This source file is part of MyGUI. For the latest info, see http://mygui.info/
* Distributed under the MIT License
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
*/
#ifndef MYGUI_DATA_STREAM_HOLDER_H_
#define MYGUI_DATA_STREAM_HOLDER_H_
#include "MyGUI_Prerequest.h"
#include "MyGUI_DataManager.h"
namespace MyGUI
{
class DataStreamHolder
{
public:
DataStreamHolder(IDataStream* _data) :
mData(_data)
{
}
DataStreamHolder(const DataStreamHolder& _other) = default;
~DataStreamHolder()
{
DataManager::getInstance().freeData(mData);
}
IDataStream* getData()
{
return mData;
}
private:
IDataStream* mData;
};
} // namespace MyGUI
#endif // MYGUI_DATA_STREAM_HOLDER_H_
MyGUI_DataManager.h
MyGUI_Prerequest.h
MyGUI::DataManager::freeData
virtual void freeData(IDataStream *_data)=0
MyGUI::DataManager::getInstance
static DataManager & getInstance()
MyGUI::DataStreamHolder::DataStreamHolder
DataStreamHolder(const DataStreamHolder &_other)=default
MyGUI::DataStreamHolder::getData
IDataStream * getData()
Definition MyGUI_DataStreamHolder.h:31
MyGUI::DataStreamHolder::DataStreamHolder
DataStreamHolder(IDataStream *_data)
Definition MyGUI_DataStreamHolder.h:19
MyGUI::DataStreamHolder::~DataStreamHolder
~DataStreamHolder()
Definition MyGUI_DataStreamHolder.h:26
MyGUI::IDataStream
Definition MyGUI_IDataStream.h:17
MyGUI
Definition MyGUI_ActionController.h:15