Detailed Description
This chapter contains all relevant
information on very fundamental definitions and classes used
throughout BALL (part of the
Foundation Classes).
Define Documentation
| #define
BALL_CREATE |
( |
name
|
|
) |
|
|
| |
Value:
\
virtual void* create(bool = 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);\
}
Virtual construction macro.
This macro is used to define the virtual create
method for classes that do not define a copy constructor
taking a second argument (boolean, deep or shallow copy).
On inclusion of this macro in the public interface of a
class, the virtual creation method becomes available. The
create method's signature is as follows: virtual
void* create(bool deep = true, bool empty = false)
const
- The create method either creates an empty default
object of the class (
empty == true)
or a copy of the object. The use of the create method
requires a (public) default constructor (when creating
an empty copy) and a copy constructor taking a
reference to an object. The macro also implements a
static method createDefault that returns a
void pointer to a new instance of
name.
- Parameters:
-
|
| #define
BALL_CREATE_DEEP |
( |
name
|
|
) |
|
|
| |
Value:
\
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);\
}
Virtual construction macro.
This macro is used to define the virtual create
method. On inclusion of this macro in the public
interface of a class, the virtual creation method becomes
available. The create method's signature is as follows:
virtual void* create(bool deep = true, bool
empty = false) const
- The create method either creates an empty default
object of the class (
empty == true)
or a copy of the object. The copy is either deep
(deep == true) or shallow
(deep == false). By default, the
create methods returns a pointer to a deep copy of the
object. The use of the create method requires a
(public) default constructor (when creating an empty
copy) or a copy constructor.
- The macro also implements a static method
createDefault that returns a void pointer
to a new instance of name.
- Parameters:
-
|
| #define
BALL_DEFINE_CREATE |
( |
name
|
|
) |
|
|
| |
Value:
\
virtual void* create(bool deep = true, bool empty = false) const;\
static void* createDefault();
Virtual cloning method definition macro.
If the create method has to be implemented by the
user, this macro just defines the create method and the
createDefault method. The function signatures are:
virtual void* create(bool deep = true, bool empty = false) const;
static void* createDefault();
|
Typedef Documentation
| |
Byte type.
Use this type to represent byte data (8 bit length). A
Byte is always unsigned.
- Size: 8 bit
- persistent
|
| |
Distance type.
Use this type to represent distances in indices.
Signed.
- Size: 32 bit
- persistent
|
| |
Double-precision real type.
Use this type to represent double precision floating
point numbers.
- Size: 64 bit
- persistent
|
| |
Error code property type.
Use this type to represent (signed) error codes.
- Size: 32 bit
- persistent
- See also:
- PropertyManager
|
| |
Handle type.
Use this type to represent handles. Handles are
used for the non-ambiguous identification of objects
(e.g. object derived from Object ). Handles are
unsigned.
- Size: 32 bit
- persistent
|
| |
HashIndex type.
Use this type to access the result of a hash
functions. HashIndex is unsigned.
- Size: 32 bit
- persistent
|
| |
Index type.
Use this type to represent indices (e.g. in strings or
other sequences). Theses indices may be signed, contrary
to the Size type.
- Size: 32 bit
- persistent
|
| |
Long signed int type.
Use this type to represent very long (64 bit) indices.
Theses indices may be signed, contrary to the LongSize
type.
- Size: 64 bit
- persistent
|
| |
Long unsigned int type.
Use this type to represent sizes of containers,
sequences or alike. Variables of type LongSize are
unsigned.
- Size: 64 bit
- persistent
|
| |
Unsigned int with the same size as a pointer.
Used for internal conversion issues mostly.
Size: 32/64 bit (platform dependent)
|
| |
Position type.
Use this type to represent positions (e.g. in a
container) that cannot be negative (contrary to Index ).
- Size: 32 bit
- persistent
|
| |
Unnamed property type.
Use this type to represent (unnamed) properties.
- Size: 32 bit
- persistent
- See also:
- PropertyManager
|
| |
Real type.
Use this type to represent standard floating point
numbers.
- Size: 32 bit
- persistent
|
| |
Size type.
Use this type to represent sizes of containers,
sequences or alike. Variables of type Size are
unsigned.
- Size: 32 bit
- persistent
|
| |
Time type.
Use this type to represent a point in time (as a
replaecement for time_t).
- Size: platform dependent
- not persistent
|
Function Documentation
|
BALL_EXPORT std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
const
Exception::GeneralException & |
e |
|
) |
|
|
| |
Output operator for exceptions.
All BALL exceptions can be printed to an arbitrary
output stream. Information written contains the exception
class, the error message, and the location (file, line
number). The following code block can thus be used to
catch any BALL exceptions and convert them to human
readable information:
try
{
.... // some code which potentially throws an exception
}
catch (Exception::GeneralException e)
{
Log.error() << "caught exception: " << e << std::endl;
}
|
|
BALL_EXPORT string streamClassName |
( |
const
std::type_info & |
t |
) |
|
|
| |
Returns a unique name for a class.
This name contains no blanks. It is usually derived by
substituting all blanks in the name (as returned by
RTTI::getName()) with
underscores ("_"). In the case of gcc,
however a name demangling decodes the string first. This
function is needed for object persistence.
- Parameters:
-
|
t |
the type_info structure as
returned by typeid |
- Returns:
- string the coverted class name
|