Class In::Message

Nested Relationships

This class is a nested type of Class MessageBruteForce::In.

Class Documentation

class flamegpu::MessageBruteForce::In::Message

Provides access to a specific message Returned by the iterator

See

In::iterator

Public Functions

__device__ inline Message(const MessageBruteForce::In &parent)

Constructs a message and directly initialises all of it’s member variables index is always init to 0

Note

See member variable documentation for their purposes

__device__ inline Message(const MessageBruteForce::In &parent, size_type index)

Alternate constructor, allows index to be manually set

Note

I think this is unused

__host__ __device__ inline bool operator==(const Message &rhs) const

Equality operator Compares all internal member vars for equality

Note

Does not compare _parent

__host__ __device__ inline bool operator!=(const Message &rhs) const

Inequality operator Returns inverse of equality operator

See

operator==(const Message&)

__host__ __device__ inline Message &operator++()

Updates the message to return variables from the next message in the message list

Returns

Returns itself

__host__ __device__ inline size_type getIndex() const

Returns the index of the message within the full message list

template<typename T, unsigned int N>
__device__ T getVariable(const char (&variable_name)[N]) const

Returns the value for the current message attached to the named variable

Parameters

variable_name – Name of the variable

Template Parameters
  • T – type of the variable

  • N – Length of variable name (this should be implicit if a string literal is passed to variable name)

Throws
  • exception::DeviceError – If name is not a valid variable within the agent (flamegpu must be built with SEATBELTS enabled for device error checking)

  • exception::DeviceError – If T is not the type of variable ‘name’ within the agent (flamegpu must be built with SEATBELTS enabled for device error checking)

Returns

The specified variable, else 0x0 if an error occurs

template<typename T, MessageNone::size_type N, unsigned int M>
__device__ T getVariable(const char (&variable_name)[M], const unsigned int &index) const

Returns the specified variable array element from the current message attached to the named variable

Parameters
  • variable_name – name used for accessing the variable, this value should be a string literal e.g. “foobar”

  • index – Index of the element within the variable array to return

Template Parameters
  • T – Type of the message variable being accessed

  • N – The length of the array variable, as set within the model description hierarchy

  • M – Length of variable_name, this should always be implicit if passing a string literal

Throws
  • exception::DeviceError – If name is not a valid variable within the agent (flamegpu must be built with SEATBELTS enabled for device error checking)

  • exception::DeviceError – If T is not the type of variable ‘name’ within the message (flamegpu must be built with SEATBELTS enabled for device error checking)

  • exception::DeviceError – If index is out of bounds for the variable array specified by name (flamegpu must be built with SEATBELTS enabled for device error checking)