Class In::Filter

Nested Relationships

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

Class Documentation

class MsgArray2D::In::Filter

This class is created when a search origin is provided to MsgArray2D::In::operator()(size_type, size_type, size_type = 1) It provides iterator access to a subset of the full message list, according to the provided search origin and radius

See

MsgArray2D::In::operator()(size_type, size_type, size_type)

Public Functions

__device__ inline Filter(const MetaData *_metadata, const Curve::NamespaceHash &_combined_hash, const size_type &x, const size_type &y, const size_type &_radius)

Constructor, takes the search parameters requried

Parameters
  • _metadata – Pointer to message list metadata

  • _combined_hash – agentfn+message hash for accessing message data

  • x – Search origin x coord

  • y – Search origin y coord

  • _radius – Search radius

__device__ inline iterator begin(void) const

Returns an iterator to the start of the message list subset about the search origin

__device__ inline iterator end(void) const

Returns an iterator to the position beyond the end of the message list subset

Note

This iterator is the same for all message list subsets

class iterator

Stock iterator for iterating MsgSpatial3D::In::Filter::Message objects

Public Functions

__device__ inline iterator(const Filter &parent, const int &relative_x, const int &relative_y)

Constructor This iterator is constructed by MsgArray2D::In::Filter::begin()(size_type, size_type, size_type)

See

MsgArray2D::In::Operator()(size_type, size_type, size_type)

__device__ inline iterator &operator++()

Moves to the next message (Prefix increment operator)

__device__ inline iterator operator++(int)

Moves to the next message (Postfix increment operator, returns value prior to increment)

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

Equality operator Compares message

__device__ inline bool operator!=(const iterator &rhs) const

Inequality operator Compares message

__device__ inline Message &operator*()

Dereferences the iterator to return the message object, for accessing variables

__device__ inline Message *operator->()

Dereferences the iterator to return the message object, for accessing variables

class Message

Provides access to a specific message Returned by the iterator

See

In::Filter::iterator

Public Functions

__device__ inline Message(const Filter &parent, const int &relative_x, const int &relative_y)

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

Note

See member variable documentation for their purposes

__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 &rhs) const

Inequality operator Returns inverse of equality operator

See

operator==(const Message&)

__device__ inline Message &operator++()

Updates the message to return variables from the next cell in the Moore neighbourhood

Returns

Returns itself

__device__ inline size_type getX() const

Returns x array index of message

__device__ inline size_type getY() const

Returns y array index of message

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