Before using these interfaces, read “Real-Time CORBA Extensions” in the VisiBroker for C++ Developer's Guide for descriptions and usage information on the supported extensions.
class RTCORBA::Current : public virtual CORBA::Current, public virtual CORBA::LocalObject
typedef RTCORBA::Current*
Current_ptr
class
RTCORBA::Current_var
The class RTCORBA::Current provides methods that allow a Real-Time CORBA Priority value to be associated with the current thread of execution, and the reading of the Real-Time CORBA Priority value presently associated with the current thread.
RTCORBA::Current is defined in IDL, as a locality constrained interface. Hence applications handle
RTCORBA::Current by means of CORBA LocalObject References, using the C++ classes
RTCORBA::Current_ptr and
RTCORBA::Current_var.
See “RTCORBA::Priority” for more information.
RTCORBA::Current is a special interface. Applications need not be concerned with which instance of it they are dealing. A reference to
RTCORBA::Current is obtained through the
resolve_initial_references method of
RTCORBA::RTORB, and is released in the normal way when it is no longer required. For details see “Real-Time CORBA Current” in the
VisiBroker for C++ Developer's Guide.
void base_priority(Priority _val);
Associates the RTCORBA::Priority value _val with the current thread of execution.
|
|
|
The Priority value to associate with the thread.
|
Gets the RTCORBA::Priority value associated with the current thread of execution.
class RTCORBA::Mutex : public virtual CORBA::
LocalObject
typedef RTCORBA::Mutex*
RTCORBA::Mutex_ptr
class
RTCORBA::Mutex_var
class
TimeBase {
typedef unsigned long long TimeT;
};
The interface RTCORBA::Mutex provides applications with a mutex synchronization primitive that is guaranteed to have the same priority inheritance properties as mutexes used internally by VisiBroker to protect ORB resources. For details, see “Real-Time CORBA Mutex API” in the
VisiBroker for C++ Developer's Guide.
RTCORBA::Mutex is defined in IDL, as a locality constrained interface. Hence applications handle
RTCORBA::Mutex instances by means of CORBA LocalObject References, using the C++ classes
RTCORBA::Mutex_ptr and
RTCORBA::Mutex_var.
See “RTCORBA::RTORB” for more information.
A new RTCORBA::Mutex is obtained using the
create_mutex operation of the
RTCORBA::RTORB interface. The new
RTCORBA::Mutex is created in an unlocked state.
When the RTCORBA::Mutex is no longer needed, it is destroyed using the
destroy_mutex operation of
RTCORBA::RTORB. See
“RTCORBA::RTORB” for details.
Note that if the RTCORBA::Mutex_var type is used in place of the
RTCORBA::Mutex_ptr type, the reference is automatically released when the
_var instance goes out of scope, but the
RTCORBA::Mutex instance it refers to is not automatically destroyed. The
RTCORBA::Mutex instance must still be destroyed with a call to
destroy_mutex.
Locks the RTCORBA::Mutex. When the
RTCORBA::Mutex object is in the unlocked state, the first thread to call the
lock() operation causes the Mutex object to change to the locked state. Subsequent threads that call the
lock() operation while the Mutex object is still in the locked state will block until the owner thread unlocks it.
Attempts to lock the RTCORBA::Mutex, waiting for a maximum of
_max_wait amount of time. Returns true if the lock is successfully taken within the time, or false if it could not be taken before the time expired.
The type RTCORBA::NativePriority is used to represent priorities in the priority scheme of the particular Operating System that the Real-Time ORB is running on. Real-Time CORBA applications only use
RTCORBA::NativePriority values in special circumstances:
typedef CORBA::Short RTCORBA::Priority
static const Priority
RTCORBA::minPriority; // 0
static const Priority
RTCORBA::maxPriority; // 32767
The type RTCORBA::Priority should be used to represent priority values in a Real-Time CORBA application. These values are mapped on to the Native Priority scheme of the particular Operating System that the application is running on by the currently installed Priority Mapping. For a detailed discussion of Real-Time CORBA Priority, see “Real-Time CORBA Priority” in the
VisiBroker for C++ Developer's Guide.
RTCORBA::Priority values are in the range
0 to
32767. However, it is not expected that this full range of priorities will be used in a Real-Time CORBA system. Instead, the application system designer should decide on a suitable range of priorities for that system, and implement a Priority Mapping that only allows priority values in that range. For many applications the default valid range of 0 to 31 is acceptable, but there might still be reasons to override the default Priority Mapping. See
“RTCORBA::PriorityMapping”for details.
class RTCORBA::PriorityMapping
The RTCORBA::PriorityMapping class facilitates the mapping of
RTCORBA::Priority values to and from the Native Priority scheme of the Operating System the Real-Time ORB is running on. The ORB calls out to a Priority Mapping object whenever it needs to map a
RTCORBA::Priority value to a
RTCORBA::NativePriority value or vice versa.
A Real-Time CORBA application should describe its priorities in terms of RTCORBA::Priority values. However, the application might need to make explicit use of the installed Priority Mapping, in order to interact directly with the Operating System or some other non-CORBA subsystem. For details see “Using Native Priorities in VisiBroker Application Code” in the
VisiBroker for C++ Developer's Guide.
The range of RTCORBA::Priority values supported by a Priority Mapping should always start from zero. The Real-Time ORB expects
RTCORBA::Priority zero to be valid. Also, this convention makes integration of different Real-Time CORBA systems on the same node easier.
The RTCORBA::PriorityMapping IDL type is defined as a 'native' IDL type. This means that its mapping to different programming languages is defined on a per-language basis. The C++ class representing
RTCORBA::PriorityMapping has the following declaration:
virtual CORBA::Boolean to_CORBA (
RTCORBA::NativePriority native_priority,
RTCORBA::Priority &corba_priority ) = 0;
This method maps a given Native Priority value, native_priority, to a Real-Time CORBA Priority value. If the Native Priority value is in the range supported by this Priority Mapping, the resultant Real-Time CORBA Priority value is stored in
corba_priority, and a true value is returned. Otherwise
corba_priority is not changed, and a false is returned.
This method maps a given Real-Time CORBA Priority value, corba_priority, to a Native Priority value. If the Real-Time CORBA Priority value is in the range supported by this Priority Mapping, the resultant Native Priority value is stored in
native_priority, and a true value is returned. Otherwise
native_priority is not changed, and a false value is returned.
enum RTCORBA::PriorityModel {
CLIENT_PROPAGATED,
SERVER_DECLARED
};
class RTCORBA::PriorityModelPolicy : public virtual CORBA::Policy, public virtual CORBA::LocalObject
An instance of this Real-Time Policy type is created by calling the create_priority_model_policy method of
RTCORBA::RTORB. The Policy instance can then be used to configure a Real-Time POA at the time of its creation, by passing it into the
create_POA method, as a member of the Policy List parameter.
class RTCORBA::RTORB : public virtual
CORBA::LocalObject
typedef RTCORBA::RTORB*
RTCORBA::RTORB_ptr
class
RTCORBA::RTORB_var
The interface RTCORBA::RTORB provides methods for the management of Real-Time CORBA Threadpools and Mutexes, and to create instances of Real-Time CORBA Policies.
RTCORBA::RTORB is defined in IDL, as a locality constrained interface. Hence applications handle
RTCORBA::RTORB by means of CORBA LocalObject References, using the C++ classes
RTCORBA::RTORB_ptr and
RTCORBA::RTORB_var.
As stated in the VisiBroker for C++ Developer's Guide, to support Real-Time CORBA Extensions the VisiBroker for C++ ORB has to operate in a special 'real-time compatible' mode, the behavior and semantics of which differ from the regular mode of operation. Since obtaining an “RTORB” reference automatically puts the ORB in this special mode, you should obtain an “RTORB” reference as early as possible in your application code to avoid any possible inconsistency in behavior.
See “RTCORBA::Mutex”,
“RTCORBA::Priority”,
“RTCORBA::ThreadpoolId”, and
“RTCORBA::ThreadpoolPolicy”. For details on the use of Real-Time CORBA Threadpools, see “Threadpools” in the
VisiBroker for C++ Developer's Guide.
To use the Real-Time ORB operations, the application must have a reference to the Real-Time ORB instance. This reference can be obtained any time after the call to ORB_init, and is obtained through the
resolve_initial_references operation on
CORBA::ORB, with the object ID string “RTORB” as the parameter. For details, see “Real-Time CORBA ORB” in the
VisiBroker for C++ Developer's Guide.
void destroy_mutex( Mutex_ptr _the_mutex );
ThreadpoolId create_threadpool(
CORBA::ULong _stacksize,
CORBA::ULong _static_threads,
CORBA::ULong _dynamic_threads,
Priority _default_priority,
CORBA::Boolean _allow_request_buffering = 0,
CORBA::ULong _max_buffered_requests = 0,
CORBA::ULong _max_request_buffer_size = 0 );
void destroy_threadpool( ThreadpoolId _threadpool );
void threadpool_idle_time(
ThreadpoolId _threadpool,
CORBA::ULong _seconds );
PriorityModelPolicy create_priority_model_policy(
in PriorityModel _priority_model,
in Priority _server_priority );
Creates an instance of the RTCORBA::PriorityModelPolicy policy object, for use in configuring one or more Real-Time POAs. See
“RTCORBA::PriorityModel” and
“RTCORBA::PriorityModelPolicy”.
|
|
|
Either RTCORBA::SERVER_DECLARED for the Server Declared Priority Model, or RTCORBA::CLIENT_PROPAGATED for the Client Priority Propagation Model.
|
|
|
Creates an instance of the RTCORBA::ThreadpoolPolicy policy object, for use in configuring one or more Real-Time POAs.
Values of the type RTCORBA::ThreadpoolId are used to identify Real-Time CORBA Thread-pools. A value of this type is returned from the
create_threadpool method of
RTCORBA::RTORB.
The ID can be used to initialize an instance of a Threadpool Policy, which in turn can be passed in to a call to create_POA, as a member of the PolicyList parameter, to configure a Real-Time POA. For details, see
“RTCORBA::RTORB”,
“RTCORBA::ThreadpoolPolicy”, and the section “Association of an Object Adapter with a Threadpool” in the
VisiBroker for C++ Developer's Guide.
class RTCORBA::ThreadpoolPolicy : public virtual CORBA::Policy, public virtual CORBA::LocalObject
An instance of this Real-Time Policy type is created by calling the create_threadpool_policy method of
RTCORBA::RTORB. The Policy instance can then be used to configure a Real-Time POA at the time of its creation, by passing it into the
create_POA method, as a member of the Policy List parameter. See
“RTCORBA::RTORB”,
“RTCORBA::ThreadpoolId”, and the section “Association of an Object Adapter with a Threadpool” in the
VisiBroker for C++ Developer's Guide for more information.