Sierra Toolkit Version of the Day
stk::MessageCode Struct Reference

Class MessageCode declares a message identifier and throttle characteristics for a message. THESE MUST BE DECLARED STATIC. More...

#include <RuntimeMessage.hpp>

Collaboration diagram for stk::MessageCode:

List of all members.

Public Member Functions

 MessageCode (size_t throttle_cutoff=5, int throttle_group=MSG_APPLICATION)
 MessageCode (MessageId message_id, size_t throttle_cutoff, int throttle_group)

Public Attributes

MessageId m_id
 Message identifier.
Throttle m_throttle
 Throttle characteristics.

Static Public Attributes

static MessageCode s_defaultMessageCode
 Default message code.

Detailed Description

Class MessageCode declares a message identifier and throttle characteristics for a message. THESE MUST BE DECLARED STATIC.

All messages have an associated message code. This message code is used to identify a message for throttling and aggregation.

Message identifiers must be consist from reference to reference, unique for each instance, and yet consist within each instance across multiple processors. To meet these criteria, the message identifier is implemented as a static memory location. It must be declared by the application developer as static. This results in the linker selecting an address for each instance, which never changes from reference to reference, is unique for each instance and the same regardless of executable (assuming the executable is mapped into the same memory location for each process). In order to remove the pointer-ness of the static memory location, the address is cast to a pointer difference type which is an integral type by subtracting the zero pointer from it.

Definition at line 124 of file RuntimeMessage.hpp.


Constructor & Destructor Documentation

stk::MessageCode::MessageCode ( size_t  throttle_cutoff = 5,
int  throttle_group = MSG_APPLICATION 
) [inline]

Creates a new MessageCode instance.

Parameters:
throttle_cutoffa size_t value to display before the message is no longer displayed.
throttle_groupan int value to identify the throttle group that this message belongs to.

Definition at line 136 of file RuntimeMessage.hpp.

stk::MessageCode::MessageCode ( MessageId  message_id,
size_t  throttle_cutoff,
int  throttle_group 
) [inline]

Creates a new MessageCode instance. Be particularly careful when usnig this constructor. The message_id value must be the same on all processors for deferred message reporting to work properly.

Parameters:
message_ida MessageId value of the message id. This value must be the same for each message across all processors.
throttle_cutoffa size_t value to display before the message is no longer displayed.
throttle_groupan int value to identify the throttle group that this message belongs to.

Definition at line 156 of file RuntimeMessage.hpp.


The documentation for this struct was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends