Class WrapFilter::Message

Nested Relationships

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

Class Documentation

class Message

Provides access to a specific message Returned by the iterator

Public Functions

__device__ inline Message(const WrapFilter &parent, const int relative_cell_x, const int relative_cell_y, const int relative_cell_z, const int _cell_index_max, const int _cell_index)

Constructs a message and directly initialises all of it’s member variables

Note

See member variable documentation for their purposes

__device__ inline Message(const WrapFilter &parent)

False minimal constructor used by iterator::end()

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

Equality operator Compares all internal member vars for equality

Note

Does not compare _parent

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

This should only be called to compare against end() It has been modified to check for end of iteration with minimal instructions Therefore it does not even perform the equality operation

Note

Use operator==() if proper equality is required

__device__ inline Message &operator++()

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

Returns:

Returns itself

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)

Returns:

The specified variable, else 0x0 if an error occurs

template<typename T, flamegpu::size_type N, unsigned int M>
__device__ T getVariable(const char (&variable_name)[M], 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 FLAMEGPU_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 FLAMEGPU_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 FLAMEGPU_SEATBELTS enabled for device error checking)

__device__ inline float getVirtualX() const

Returns the virtual x variable of the message, relative to the search origin This is the closest x coordinate the message would have, relative to the observer’s x coordinate in a wrapped environment

__device__ inline float getVirtualY() const

Returns the virtual y variable of the message, relative to the search origin This is the closest y coordinate the message would have, relative to the observer’s y coordinate in a wrapped environment

__device__ inline float getVirtualZ() const

Returns the virtual z variable of the message, relative to the search origin This is the closest z coordinate the message would have, relative to the observer’s z coordinate in a wrapped environment

__device__ inline float getVirtualX(const float x1) const

Returns the virtual x variable of the message This is the closest x coordinate the message would have, relative to the observer’s x coordinate in a wrapped environment

Parameters:

x1 – The x coordinate of the observer

__device__ inline float getVirtualY(const float y1) const

Returns the virtual y variable of the message This is the closest y coordinate the message would have, relative to the observer’s y coordinate in a wrapped environment

Parameters:

y1 – The y coordinate of the observer

__device__ inline float getVirtualZ(const float z1) const

Returns the virtual z variable of the message This is the closest z coordinate the message would have, relative to the observer’s z coordinate in a wrapped environment

Parameters:

z1 – The z coordinate of the observer