Page MenuHomec4science

lm_object.hh
No OneTemporary

File Metadata

Created
Fri, Oct 4, 05:08

lm_object.hh

#ifndef __LIBMULTISCALE_LM_OBJECT_HH__
#define __LIBMULTISCALE_LM_OBJECT_HH__
/* -------------------------------------------------------------------------- */
#include "auto_arguments.hh"
#include "lm_common.hh"
#include "lm_globals.hh"
/* -------------------------------------------------------------------------- */
__BEGIN_LIBMULTISCALE__
/* -------------------------------------------------------------------------- */
struct CommGroup;
/* -------------------------------------------------------------------------- */
using dispatch = AutoDispatch::dispatch;
template <typename T, typename... Ts>
using enable_if_type = AutoDispatch::enable_if_type<T, Ts...>;
/* -------------------------------------------------------------------------- */
/**
* Class LMObject
* objects having an ID
*/
class LMObject : public AutoDispatch::Argument {
public:
friend class Component;
LMObject(const LMID &id);
static int random_release();
virtual const LMID &getID() const;
virtual void setID(const LMID &id);
//! set the communication group
virtual void setCommGroup(CommGroup &group);
//! return the communication group
CommGroup &getCommGroup() const;
virtual void acquireContext(const LMObject &obj);
//! return actual release
UInt getRelease() const;
//! invalidate the object (if component->forces recompute)
void invalidate();
protected:
//! return actual release
void setRelease(UInt r);
//! increment the release
virtual void incRelease();
private:
//! general id
LMID id;
//! general release number
UInt release;
protected:
CommGroup *comm_group;
};
__END_LIBMULTISCALE__
#endif // __LIBMULTISCALE_LM_OBJECT_HH__

Event Timeline