-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdnullobject.hpp
39 lines (30 loc) · 1.15 KB
/
dnullobject.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef _DESTRUCT_DNULLOBJECT_HPP_
#define _DESTRUCT_DNULLOBJECT_HPP_
#include "destruct.hpp"
#include "dobject.hpp"
namespace Destruct
{
class DNullObject : public DObject
{
public:
EXPORT static DNullObject* instance(); //Use singleton::newObject() ? DObject<Singleton >
EXPORT DObject* clone() const;
EXPORT DValue getValue(size_t index) const;
EXPORT void setValue(size_t index, DValue const&);
EXPORT DValue call(size_t index, DValue const&);
EXPORT DValue getValue(DUnicodeString const& name) const;
EXPORT void setValue(DUnicodeString const& name, DValue const& value);
EXPORT DValue call(DUnicodeString const& name, DValue const& value);
protected:
BaseValue* getBaseValue(size_t index);
BaseValue const* getBaseValue(size_t index) const;
void destroy(); //singleton must avoid to call ~DNullObject who use a recuring template pattern
private:
static DStruct* __dstructInstance();
DNullObject();
DNullObject(DValue const& args);
~DNullObject();
};
static DNullObject* const DNone = DNullObject::instance();
}
#endif