MyGUI: MyGUI_DataStreamHolder.h Source File

MyGUI 3.4.3

MyGUI_DataStreamHolder.h
Go to the documentation of this file.
1/*
2 * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3 * Distributed under the MIT License
4 * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5 */
6
7#ifndef MYGUI_DATA_STREAM_HOLDER_H_
8#define MYGUI_DATA_STREAM_HOLDER_H_
9
10#include "MyGUI_Prerequest.h"
11#include "MyGUI_DataManager.h"
12
13namespace MyGUI
14{
15
16 class DataStreamHolder
17 {
18 public:
19 DataStreamHolder(IDataStream* _data) :
20 mData(_data)
21 {
22 }
23
24 DataStreamHolder(const DataStreamHolder& _other) = default;
25
26 ~DataStreamHolder()
27 {
28 DataManager::getInstance().freeData(mData);
29 }
30
31 IDataStream* getData()
32 {
33 return mData;
34 }
35
36 private:
37 IDataStream* mData;
38 };
39
40} // namespace MyGUI
41
42#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