About
The MAXON API utilizes various standard and modern C++ technologies. Any developer working with the MAXON API should have a working knowledge of these technologies and generally an advanced knowledge of C++ and object orientated programming.
C++ Techniques
Templates are used to avoid duplicated code and to define generic functionality.
Definition: basearray.h:415
MAXON_ATTRIBUTE_FORCE_INLINE ResultRef< T > Append(ARG &&x)
Appends a new element at the end of the array and constructs it using the forwarded value.
Definition: basearray.h:619
#define iferr_return
Definition: resultbase.h:1521
Macros are used to mark certain parts of the code or to automatically generate utility code. Macros are used heavily in the interface and registry system. E.g. interface declarations use these macros: MAXON_INTERFACE_BASES, MAXON_INTERFACE, MAXON_METHOD and MAXON_DECLARATION.
{
public:
};
#include "simpleclass1.hxx"
MAXON_DECLARATION(SimpleClassRef, OtherSimpleClass,
"net.maxonexample.othersimpleclass");
#include "simpleclass2.hxx"
[interfaces_basic_virtual_interface]
Definition: simpleclass.h:15
MAXON_METHOD void SetNumber(maxon::Int number)
MAXON_INTERFACE(SimpleClassInterface, MAXON_REFERENCE_NORMAL, "net.maxonexample.interfaces.simpleclass")
MAXON_METHOD maxon::Int GetNumber() const
Definition: objectbase.h:696
Int64 Int
signed 32/64 bit int, size depends on the platform
Definition: apibase.h:213
#define MAXON_REFERENCE_NORMAL(FREEIMPL)
Definition: interfacebase.h:1184
#define MAXON_DECLARATION(T, Name, id,...)
Definition: module.h:945
#define MAXON_METHOD
Definition: interfacebase.h:1012
#define MAXON_INTERFACE_BASES(...)
Definition: objectbase.h:1049
Some generic macros can be used in any project, see Generic Macros.
Namespaces are used to avoid symbol collisions. The complete MAXON API is defined in the maxon
namespace. It is recommended to use custom namespaces as much as possible.
Lambdas are used instead of callback functions. See also maxon::Delegate.
Enumeration classes are used instead of simple enumerations.
Avoided Techniques
The MAXON API does not use exceptions. Instead the custom error system should be used. See Error Handling.
Further Reading