MyGUI
3.2.1
Main Page
Related Pages
Namespaces
Data Structures
Files
Examples
File List
Globals
mygui
MyGUIEngine
src
MyGUI_Any.cpp
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
#include "
MyGUI_Precompiled.h
"
8
#include "
MyGUI_Any.h
"
9
10
namespace
MyGUI
11
{
12
13
Any::AnyEmpty
Any::Null
;
14
15
Any::Any
() :
16
mContent(
nullptr
)
17
{
18
}
19
20
Any::Any
(
const
Any::AnyEmpty
& value) :
21
mContent(
nullptr
)
22
{
23
}
24
25
Any::Any
(
const
Any
& other) :
26
mContent(other.mContent ? other.mContent->clone() :
nullptr
)
27
{
28
}
29
30
Any::~Any
()
31
{
32
delete
mContent;
33
}
34
35
Any
&
Any::swap
(
Any
& rhs)
36
{
37
std::swap(mContent, rhs.mContent);
38
return
*
this
;
39
}
40
41
Any
&
Any::operator =
(
const
Any::AnyEmpty
& rhs)
42
{
43
delete
mContent;
44
mContent =
nullptr
;
45
return
*
this
;
46
}
47
48
Any
&
Any::operator =
(
const
Any
& rhs)
49
{
50
Any
(rhs).swap(*
this
);
51
return
*
this
;
52
}
53
54
bool
Any::empty
()
const
55
{
56
return
!mContent;
57
}
58
59
const
std::type_info&
Any::getType
()
const
60
{
61
return
mContent ? mContent->getType() :
typeid
(void);
62
}
63
64
void
*
Any::castUnsafe
()
const
65
{
66
return
mContent ?
static_cast<
Any::Holder<void*> *
>
(this->mContent)->held :
nullptr
;
67
}
68
69
}
// namespace MyGUI
Generated on Wed Aug 20 2014 00:03:31 for MyGUI by
1.8.3.1