## NAME

ACE_Dynamic_Message_Strategy - An abstract base class which provides dynamic priority evaluation methods for use by the `ACE_Dynamic_Message_Queue` class or any other class which needs to manage the priorities of a collection of `ACE_Message_Block`s dynamically.

## SYNOPSIS

    #include <ace/Message_Block.h>

    class ACE_Dynamic_Message_Strategy
    {
      public:
            enum Priority_Status{ PENDING = 0x01,
            LATE = 0x02,
            BEYOND_LATE = 0x04,
            ANY_STATUS = 0x07 };

        ACE_Dynamic_Message_Strategy (
            u_long static_bit_field_mask,
            u_long static_bit_field_shift,
            u_long dynamic_priority_max,
            u_long dynamic_priority_offset
            );
        virtual ~ACE_Dynamic_Message_Strategy ();
        Priority_Status priority_status (
            ACE_Message_Block & mb,
            const ACE_Time_Value & tv
            );
        u_long static_bit_field_mask (void);
        void static_bit_field_mask (u_long);
        u_long static_bit_field_shift (void);
        void static_bit_field_shift (u_long);
        u_long dynamic_priority_max (void);
        void dynamic_priority_max (u_long);
        u_long dynamic_priority_offset (void);
        void dynamic_priority_offset (u_long);
        virtual void dump (void) const;
      protected:
        virtual void convert_priority (
            ACE_Time_Value & priority,
            const ACE_Message_Block & mb
            ) = 0;
        u_long static_bit_field_mask_;
        u_long static_bit_field_shift_;
        u_long dynamic_priority_max_;
        u_long dynamic_priority_offset_;
        ACE_Time_Value max_late_;
        ACE_Time_Value min_pending_;
        ACE_Time_Value pending_shift_;
    };

## DESCRIPTION

Methods for deadline and laxity based priority evaluation are provided. These methods assume a specific partitioning of the message priority number into a higher order dynamic bit field and a lower order static priority bit field. The default partitioning assumes an unsigned dynamic message priority field of 22 bits and an unsigned static message priority field of 10 bits. This corresponds to the initial values of the static class members. To provide a different partitioning, assign a different set of values to the static class memebers before using the static member functions.

## Message priority status

Values are defined as bit flags so that status combinations may be specified easily.

    ACE_Dynamic_Message_Strategy (
        u_long static_bit_field_mask,
        u_long static_bit_field_shift,
        u_long dynamic_priority_max,
        u_long dynamic_priority_offset
        );

ctor

    virtual ~ACE_Dynamic_Message_Strategy ();

virtual dtor

    Priority_Status priority_status (
        ACE_Message_Block & mb,
        const ACE_Time_Value & tv
        );

Updates the message's priority and returns its priority status.

    u_long static_bit_field_mask (void);

Get static bit field mask.

    void static_bit_field_mask (u_long);

Set static bit field mask.

    u_long static_bit_field_shift (void);

Get left shift value to make room for static bit field.

    void static_bit_field_shift (u_long);

Set left shift value to make room for static bit field.

    u_long dynamic_priority_max (void);

Get maximum supported priority value.

    void dynamic_priority_max (u_long);

Set maximum supported priority value.

    u_long dynamic_priority_offset (void);

Get offset to boundary between signed range and unsigned range.

    void dynamic_priority_offset (u_long);

Set offset to boundary between signed range and unsigned range.

    virtual void dump (void) const;

Dump the state of the strategy.

## AUTHOR

Doug Schmidt

## LIBRARY

ace