Loading...
Searching...
No Matches
create.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_COMMON_CREATE_H
#define BALL_COMMON_CREATE_H
#define BALL_CREATE_DEEP(name)\
\
virtual void* create(bool deep = true, bool empty = false) const\
{\
void* ptr;\
if (empty == true)\
{\
ptr = (void*)new name;\
}\
else\
{\
ptr = (void*)new name(*this, deep);\
}\
\
return ptr;\
}\
\
static void* createDefault()\
{\
return static_cast<void*>(new name);\
}
#define BALL_CREATE(name)\
\
virtual void* create(bool /* deep */ = true, bool empty = false) const\
{\
void* ptr;\
if (empty == true)\
{\
ptr = (void*)new name;\
}\
else\
{\
ptr = (void*)new name(*this);\
}\
\
return ptr;\
}\
\
static void* createDefault()\
{\
return static_cast<void*>(new name);\
}
#define BALL_DEFINE_CREATE(name)\
\
virtual void* create(bool deep = true, bool empty = false) const;\
static void* createDefault();
#endif // BALL_COMMON_CREATE_H