mbsim  4.0.0
MBSim Kernel
MBSim::AllocateBase Struct Referenceabstract

#include <objectfactory_part.h>

Inheritance diagram for MBSim::AllocateBase:
[legend]

Public Member Functions

virtual fmatvec::Atom * operator() () const =0
 Implement this function to allocate a new object. More...
 
virtual bool isEqual (const AllocateBase &other) const =0
 

Detailed Description

Base wrapper class to allocate an object derived from fmatvec::Atom. We can use just a function pointer, fmatvec::Atom* (*allocateFct)(), for the same purpose. But for other more complex allocator functions (e.g. Python objects using swig directors) this is not flexible enought since we need to provide a custom compare function (isEqual).

Member Function Documentation

◆ isEqual()

virtual bool MBSim::AllocateBase::isEqual ( const AllocateBase other) const
pure virtual

Implement this function to compare whether this class and the instance other allocate the same object type when calling operator(). (we use isEqual here instead of operator== to avoid problems with some swig versions)

Implemented in MBSim::Allocate< CreateType >.

◆ operator()()

virtual fmatvec::Atom * MBSim::AllocateBase::operator() ( ) const
pure virtual

Implement this function to allocate a new object.

Implemented in MBSim::Allocate< CreateType >.


The documentation for this struct was generated from the following file: