TAO_EC_Thread_Flags Class Reference

Parse thread flags from string to a long. More...

#include <EC_Thread_Flags.h>

Collaboration diagram for TAO_EC_Thread_Flags:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 TAO_EC_Thread_Flags ()
 TAO_EC_Thread_Flags (const char *symbolic_flags)
 See operator=().
 ~TAO_EC_Thread_Flags ()
const TAO_EC_Thread_Flagsoperator= (const char *symbolic_flags)
 Assign a new set of symbolic flags, setting flags, scope, and sched as possible.
long flags () const
 Returns numeric equivalent of the thread flags suitable for passing to ACE_Task::activate.
long scope () const
 Returns value of THR_SCOPE_* used, or zero if unknown.
long sched () const
 Returns value of THR_SCHED_* used, or zero if unknown.
 operator long () const
 Synonym for flags(), i.e., syntactic sugar.
long default_priority () const
 Return an acceptable default priority for the scheduler returned by sched().

Static Public Attributes

static Supported_Flag supported_flags_ []

Protected Member Functions

void parse_symbols (const char *syms)
 Value of THR_SCHED_*.

Protected Attributes

long flags_
long scope_
 Value of all flags OR'd together.
long sched_
 Value of THR_SCOPE_*.

Classes

struct  Supported_Flag


Detailed Description

Parse thread flags from string to a long.

Encapsulate flags used for creating threads with ACE_OS::thr_create and ACE_Task::activate.

Note:
On platforms that do not support the thread schedulers, the ACE OS adaptation layer preserves the symbols for THR_SCHED_*, but defines them as zero. Thus, on such platforms, setting a scheduler in the flags, then inquiring for the scheduler type will yield the same result as an unknown or unset scheduler.
This should really be part of ACE or ACE_OS, and maybe someday it will, but right now it's not.

Constructor & Destructor Documentation

TAO_EC_Thread_Flags::TAO_EC_Thread_Flags (  )  [inline]

TAO_EC_Thread_Flags::TAO_EC_Thread_Flags ( const char *  symbolic_flags  )  [inline]

See operator=().

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_EC_Thread_Flags::~TAO_EC_Thread_Flags (  ) 


Member Function Documentation

const TAO_EC_Thread_Flags& TAO_EC_Thread_Flags::operator= ( const char *  symbolic_flags  )  [inline]

Assign a new set of symbolic flags, setting flags, scope, and sched as possible.

The flags can be symbolic, separated by the vertical bar ('|'). In case a platform supports a creation flag not available symbolically, the user can specify a numeric value any place a symbol could be used.

See also:
TAO_EC_Thread_Flags::supported_flags
Note:
The sched value only gets set if the scheduler is specified using symbols.

long TAO_EC_Thread_Flags::flags ( void   )  const [inline]

Returns numeric equivalent of the thread flags suitable for passing to ACE_Task::activate.

long TAO_EC_Thread_Flags::scope (  )  const [inline]

Returns value of THR_SCOPE_* used, or zero if unknown.

long TAO_EC_Thread_Flags::sched (  )  const [inline]

Returns value of THR_SCHED_* used, or zero if unknown.

TAO_EC_Thread_Flags::operator long (  )  const [inline]

Synonym for flags(), i.e., syntactic sugar.

long TAO_EC_Thread_Flags::default_priority (  )  const

Return an acceptable default priority for the scheduler returned by sched().

Returns:
the priority, or ACE_DEFAULT_THREAD_PRIORITY if the scheduler is unknown.

void TAO_EC_Thread_Flags::parse_symbols ( const char *  syms  )  [protected]

Value of THR_SCHED_*.


Member Data Documentation

TAO_EC_Thread_Flags::Supported_Flag TAO_EC_Thread_Flags::supported_flags_ [static]

Initial value:

 {

    TETFSF(THR_CANCEL_DISABLE),
    TETFSF(THR_CANCEL_ENABLE),
    TETFSF(THR_CANCEL_DEFERRED),
    TETFSF(THR_CANCEL_ASYNCHRONOUS),
    TETFSF(THR_BOUND),
    TETFSF(THR_NEW_LWP),
    TETFSF(THR_DETACHED),
    TETFSF(THR_SUSPENDED),
    TETFSF(THR_DAEMON),
    TETFSF(THR_JOINABLE),
    TETFSF(THR_SCHED_FIFO),
    TETFSF(THR_SCHED_RR),
    TETFSF(THR_SCHED_DEFAULT),
    TETFSF(THR_EXPLICIT_SCHED),
    TETFSF(THR_SCOPE_SYSTEM),


  }

long TAO_EC_Thread_Flags::flags_ [protected]

long TAO_EC_Thread_Flags::scope_ [protected]

Value of all flags OR'd together.

long TAO_EC_Thread_Flags::sched_ [protected]

Value of THR_SCOPE_*.


The documentation for this class was generated from the following files:
Generated on Fri Dec 14 04:06:55 2007 for TAO_RTEvent by  doxygen 1.5.3-6