Class HostNewAgentAPI

Class Documentation

class HostNewAgentAPI

This is the main API class used by a user for creating new agents on the host

Public Functions

inline explicit HostNewAgentAPI(NewAgentStorage &_s)

Assigns a new agent it’s storage

inline HostNewAgentAPI(const HostNewAgentAPI &hna)

Copy Constructor This does not duplicate the agent, they both point to the same data, it updates the pointed to agent data

inline HostNewAgentAPI &operator=(const HostNewAgentAPI &hna)

Assignment Operator This copies (non-internal) agent variable data from hna

Throws:

exception::InvalidArgument – If hna is of a different agent type (has a different internal memory layout)

template<typename T>
inline void setVariable(const std::string &var_name, const T val)

Updates a variable within the new agent

template<typename T, unsigned int N = 0>
inline void setVariable(const std::string &var_name, const unsigned int index, const T val)
template<typename T, unsigned int N>
inline void setVariable(const std::string &var_name, const std::array<T, N> &val)
template<typename T>
inline T getVariable(const std::string &var_name) const

Returns a variable within the new agent

template<typename T, unsigned int N = 0>
inline T getVariable(const std::string &var_name, const unsigned int index)
template<typename T, unsigned int N>
inline std::array<T, N> getVariable(const std::string &var_name)
inline id_t getID() const

Returns the agent’s unique ID