Class MsgBucket::In

Nested Relationships

This class is a nested type of Class MsgBucket.

Class Documentation

class MsgBucket::In

This class is accessible via DeviceAPI.message_in if MsgBucket is specified in FLAMEGPU_AGENT_FUNCTION It gives access to functionality for reading bucket

Public Functions

__device__ inline In(Curve::NamespaceHash agentfn_hash, Curve::NamespaceHash msg_hash, const void *_metadata)

Constructor Initialises member variables

Parameters
  • agentfn_hash – Added to msg_hash to produce combined_hash

  • msg_hash – Added to agentfn_hash to produce combined_hash

  • _metadata – Reinterpreted as type MsgBucket::MetaData

__device__ inline Filter operator()(const IntT &key) const

Returns a Filter object which provides access to message iterator for iterating a subset of messages stored within the specified bucket

Parameters

key – The bucket to access

__device__ inline Filter operator()(const IntT &beginKey, const IntT &endKey) const

Returns a Filter object which provides access to message iterator for iterating a subset of messages within the [begin, end) range of buckets specified.

Parameters
  • beginKey – The first bin to access messages from

  • endKey – The bin beyond the last bin to access messages from

class Filter

This class is created when a search origin is provided to MsgBucket::In::operator()(IntT) It provides iterator access to the subset of messages found within the specified bucket

See

MsgBucket::In::operator()(IntT)

Public Functions

__device__ inline Filter(const MetaData *_metadata, const Curve::NamespaceHash &combined_hash, const IntT &beginKey, const IntT &endKey)

Constructor, takes the search parameters required Begin key and end key specify the [begin, end) contiguous range of bucket. (inclusive begin, exclusive end)

Parameters
  • _metadata – Pointer to message list metadata

  • combined_hash – agentfn+message hash for accessing message data

  • beginKey – Inclusive first bucket of range to access

  • endKey – Exclusive final bucket of range to access, this is the final bucket + 1

__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

__device__ inline unsigned int size(void) const

Returns the number of messages in the filtered bucket

class iterator

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

Public Functions

__device__ inline iterator(const Filter &parent, const unsigned int &cell_index)

Constructor This iterator is constructed by MsgBucket::In::Filter::begin()(IntT)

See

MsgBucket::In::Operator()(IntT)

__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 unsigned 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 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 message in the message list

Returns

Returns itself

template<typename T, size_type 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