Muscle C/C++ API: muscle::env Class Reference

muscle::env Class Reference

#include <cppmuscle.hpp>


Static Public Member Functions

static muscle_error_t init (int *argc, char ***argv)
static void finalize (void)
static bool will_stop (void)
static void send (std::string entrance_name, const void *data, size_t count, muscle_datatype_t type)
static void sendDoubleVector (std::string entrance_name, const std::vector< double > &data)
static void * receive (std::string exit_name, void *data, size_t &count, muscle_datatype_t type)
static std::vector< double > receiveDoubleVector (std::string exit_name)
static void free_data (void *ptr, muscle_datatype_t type)
static std::string get_tmp_path (void)
static bool has_next (std::string exit_name)

Static Public Attributes

static bool is_main_processor = false

Member Function Documentation

muscle_error_t muscle::env::init ( int *  argc,
char ***  argv 
) [static]

Initialize MUSCLE. Call before any other function, with pointers to the number of arguments and arguments.

void muscle::env::finalize ( void   )  [static]

Finalize MUSCLE. Call after any other function.

bool muscle::env::will_stop ( void   )  [static]

Whether MUSCLE should stop, based on the time step of the submodel and the timestamps of the received and sent messages.

void muscle::env::send ( std::string  entrance_name,
const void *  data,
size_t  count,
muscle_datatype_t  type 
) [static]

Send a message of a given MUSCLE datatype over the given conduit entrance. The size_t is the number of elements in data.

void muscle::env::sendDoubleVector ( std::string  entrance_name,
const std::vector< double > &  data 
) [static]

Send a message of a double vector over the given conduit entrance. This is a convenience message for send.

void * muscle::env::receive ( std::string  exit_name,
void *  data,
size_t &  count,
muscle_datatype_t  type 
) [static]

Receive a message of a given MUSCLE datatype over the given conduit exit. If data is null, MUSCLE will allocate data and return it. Count is used to return the message size, and if data is not null the size of the buffer that data contains. If data is non-null and the size is too small, this will lead to an unrecoverable error.

std::vector< double > muscle::env::receiveDoubleVector ( std::string  exit_name  )  [static]

void muscle::env::free_data ( void *  ptr,
muscle_datatype_t  type 
) [static]

std::string muscle::env::get_tmp_path ( void   )  [static]

static bool muscle::env::has_next ( std::string  exit_name  )  [static]


Field Documentation

bool muscle::env::is_main_processor = false [static]


Generated on Thu Oct 18 14:28:28 2012 for Muscle C/C++ API by  doxygen 1.5.6