⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 reconfig_sched_utils.h

📁 这是广泛使用的通信开源项目,对于大容量,高并发的通讯要求完全能够胜任,他广泛可用于网络游戏医学图像网关的高qos要求.更详细的内容可阅读相应的材料
💻 H
📖 第 1 页 / 共 2 页
字号:
/* -*- C++ -*- */
// Reconfig_Sched_Utils.h,v 1.21 2003/10/13 21:43:26 venkita Exp

// ============================================================================
//
// = LIBRARY
//    orbsvcs
//
// = FILENAME
//    Reconfig_Scheduler_Utils.h
//
// = AUTHOR
//     Chris Gill <cdgill@cs.wustl.edu>
//
// ============================================================================

#ifndef TAO_RECONFIG_SCHED_UTILS_H
#define TAO_RECONFIG_SCHED_UTILS_H
#include /**/ "ace/pre.h"

// Uncomment this to turn on some extra trace level debugging info,
// comment it out to turn off that extra debugging info.
//#define SCHEDULER_LOGGING

#include "ace/config-all.h"

#include "orbsvcs/Scheduler_Factory.h"
#include "orbsvcs/RtecSchedulerS.h"
#include "sched_export.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

struct TAO_RTSched_Export TAO_RT_Info_Ex
  : public RtecScheduler::RT_Info
  // = TITLE
  //   A wrapper class for the IDL-generated RT_Info operation descriptors.
  //
  // = DESCRIPTION
  //   This class provides (re)initialization methods and a validity flag
  //   for the underlying IDL-generated RT_Info descriptor.
{
  TAO_RT_Info_Ex ();
  // Default Constructor.

  TAO_RT_Info_Ex (const RtecScheduler::RT_Info &);
  // Constructor from an RT_Info
  // (also serves as a copy constructor).

  virtual ~TAO_RT_Info_Ex ();
  // Destructor.

  void operator = (const RtecScheduler::RT_Info &);
  // Assignment operator with an RT_Info on the RHS.

  virtual void reset (u_long reset_flags);
  // Resets output data members to initial values, and removes tuples
  // corresponding to the reset flags.

  virtual void enabled_state (RtecScheduler::RT_Info_Enabled_Type_t);
  // Sets the info and underlying entry's enable states.

  virtual RtecScheduler::RT_Info_Enabled_Type_t enabled_state ();
  // Returns the info's enable state.
};


struct TAO_RTSched_Export TAO_RT_Info_Tuple
  : public TAO_RT_Info_Ex
  // = TITLE
  //   An implementation class used to wrap available operation descriptors.
  //   Each operation may have one or more tuples describing different rates,
  //   etc., for the same operation.
  //
  // = DESCRIPTION
  //   This class enables admission control within the Reconfig Scheduler,
  //   which offers improved performance compared to admission control
  //   outside the scheduler.
{
  TAO_RT_Info_Tuple ();
  // Default Constructor.

  TAO_RT_Info_Tuple (const RtecScheduler::RT_Info &);
  // Constructor from an RT_Info.
  // (also serves as a copy constructor).

  virtual ~TAO_RT_Info_Tuple ();
  // Destructor.

  void operator = (const RtecScheduler::RT_Info &);
  // Assignment operator with an RT_Info on the RHS.

  int operator < (const TAO_RT_Info_Tuple &t);
  // Less-than comparison operator: orders tuples by ascending rate (descending period).

  u_long rate_index;
  // Index of the tuple in the operation's ordered available rates
};


class TAO_RTSched_Export TAO_Reconfig_Scheduler_Entry
  // = TITLE
  //   An implementation class used to decouple the available descriptors
  //   from the admitted descriptors, and to store interim scheduling results
  //   such as DFS finishing order, etc.
  //
  // = DESCRIPTION
  //   This class improves the performance of the Reconfig Scheduler
  //   by saving information from one computation for use in other
  //   computations, and simplifies the implementation logic.
{
public:

  // Info for DFS traversal, topological sort of call graph.
  enum DFS_Status {NOT_VISITED, VISITED, FINISHED};

  enum Tuple_Type {ORIGINAL = 0x01UL, PROPAGATED = 0x02UL};

  TAO_Reconfig_Scheduler_Entry (TAO_RT_Info_Ex &rt_info);
  // Constructor.

  ~TAO_Reconfig_Scheduler_Entry ();
  // Destructor.

  void remove_tuples (u_long tuple_flags = ORIGINAL | PROPAGATED);
  // Removes all tuples from the entry.

  int insert_tuple (TAO_RT_Info_Tuple &tuple,
                    Tuple_Type tuple_type = ORIGINAL,
                    int replace = 0);
  // Inserts a tuple into the appropriate tuple multiset.

  int update_tuple (TAO_RT_Info_Ex &info,
                    Tuple_Type tuple_type = ORIGINAL);
  // Updates a matching tuple.

  int register_tuples (TAO_RT_Info_Tuple ** tuple_ptr_array,
                       long &tuple_count);
  // Registers tuples into the passed tuple pointer array.

  TAO_RT_Info_Ex & orig_rt_info_data (void);
  // Accessor for stored original RT_Info data.

  void orig_rt_info_data (TAO_RT_Info_Ex &data);
  // Mutator for stored original RT_Info data.

  TAO_RT_Info_Ex * actual_rt_info ();
  // Accessor for actual RT_Info.

  void actual_rt_info (TAO_RT_Info_Ex *);
  // Mutator for actual RT_Info.

  long fwd_discovered () const;
  // Accessor for when the node was discovered in forward DFS traversal.

  void fwd_discovered (long l);
  // Mutator for when the node was discovered in forward DFS traversal.

  long rev_discovered () const;
  // Accessor for when the node was discovered in reverse DFS traversal.

  void rev_discovered (long l);
  // Mutator for when the node was discovered in reverse DFS traversal.

  long fwd_finished () const;
  // Accessor for when the node was finished in forward DFS traversal.

  void fwd_finished (long l);
  // Mutator for when the node was finished in forward DFS traversal.

  long rev_finished () const;
  // Accessor for when the node was finished in reverse DFS traversal.

  void rev_finished (long l);
  // Mutator for when the node was finished in reverse DFS traversal.

  DFS_Status fwd_dfs_status () const;
  // Accessor for forward DFS traversal status of the node.

  DFS_Status rev_dfs_status () const;
  // Accessor for reverse DFS traversal status of the node.

  void fwd_dfs_status (DFS_Status ds);
  // Mutator for forward DFS traversal status of the node.

  void rev_dfs_status (DFS_Status ds);
  // Mutator for reverse DFS traversal status of the node.

  int is_thread_delineator () const;
  // Accessor for flag indicating whether node is a thread
  // delineator.

  void is_thread_delineator (int i);
  // Mutator for flag indicating whether node is a thread
  // delineator.

  int has_unresolved_remote_dependencies () const;
  // Accessor for flag indicating whether node has unresolved remote
  // dependencies.

  void has_unresolved_remote_dependencies (int i);
  // Mutator for flag indicating whether node has unresolved remote
  // dependencies.

  int has_unresolved_local_dependencies () const;
  // Accessor for flag indicating whether node has unresolved local
  // dependencies.

  void has_unresolved_local_dependencies (int i);
  // Mutator for flag indicating whether node has unresolved local
  // dependencies.

  RtecScheduler::Time aggregate_exec_time ();
  // Accessor for effective execution time of the corresponding
  // RT_Info and all of its disjunctively (i.e., dispatching waveforms
  // are additive) executed dependants.

  void aggregate_exec_time (RtecScheduler::Time t);
  // Mutator for effective execution time of the corresponding RT_Info
  // and its disjunctively executed dependants.

  RtecScheduler::Period_t orig_tuple_period_sum ();
  // Accessor for the sum of periods for tuples directly associated
  // with the entry.  It can be used to compute the mean rate for the
  // entry.

  void orig_tuple_period_sum (RtecScheduler::Period_t p);
  // Mutator for the sum of periods for tuples directly associated
  // with the entry.  It can be used to compute the mean rate for the
  // entry.

  RtecScheduler::Period_t prop_tuple_period_sum ();
  // Accessor for the sum of periods for tuples propagated via
  // dependencies on other entries.  It can be used to compute the
  // mean rate for the entry.

  void prop_tuple_period_sum (RtecScheduler::Period_t p);
  // Mutator for the sum of periods for tuples propagated via
  // dependencies on other entries.  It can be used to compute the
  // mean rate for the entry.

  u_int orig_tuple_count ();
  //  Accessor for the number of tuples directly associated with the
  //  entry.

  void orig_tuple_count (u_int c);
  //  Mutator for the number of tuples directly associated with the
  //  entry.

  u_int prop_tuple_count ();
  // Accessor for the number of tuples propagated via dependencies on
  // other entries.

  void prop_tuple_count (u_int c);
  // Mutator for the number of tuples propagated via dependencies on
  // other entries.

  TUPLE_SET& orig_tuple_subset ();
  // Accessor for the set of tuples directly associated with the
  // entry.

  TUPLE_SET& prop_tuple_subset ();
  // Accessor for the set of tuples propagated via dependencies on
  // other entries.

  TAO_RT_Info_Tuple * current_admitted_tuple ();
  // Returns a pointer to the entry's most recently admitted tuple.
  // The pointer is zero if no tuples have been admitted so far.

  void current_admitted_tuple (TAO_RT_Info_Tuple *);
  // Sets a pointer to the entry's most recently admitted tuple.
  // The pointer is zero if no tuples have been admitted so far.

  RtecScheduler::RT_Info_Enabled_Type_t enabled_state () const;
  // Accessor for flag indicating whether or not node is enabled.

  void enabled_state (RtecScheduler::RT_Info_Enabled_Type_t);
  // Mutator for flag indicating whether or not node is enabled.

/* WSOA merge - commented out
  RtecScheduler::Period_t effective_period ();
  // Accessor for effective period of corresponding RT_Info.

  void effective_period (RtecScheduler::Period_t p);
  // Mutator for effective period of corresponding RT_Info.

  CORBA::Long effective_exec_multiplier ();
  // Accessor for effective execution time multiplier of corresponding
  // RT_Info.

  void effective_exec_multiplier (CORBA::Long l);
  // Mutator for effective execution time multiplier of corresponding
  // RT_Info.
*/

private:

  TAO_RT_Info_Ex orig_rt_info_data_;
  // Stores the values of operation characteristics as they were specified
  // in the most recent call to the Reconfig_Scheduler's set () method.
  // That way, the scheduler propagation pass can overwrite RT_Info fields
  // without losing the original values.  This is useful when

  TAO_RT_Info_Ex *actual_rt_info_;
  // Points to the actual RT_Info to which the schedling entry corresponds.

  DFS_Status fwd_dfs_status_;
  // Forward depth-first-search status of the entry.

  DFS_Status rev_dfs_status_;
  // Reverse depth-first-search status of the entry.

  long fwd_discovered_;
  // Forward depth-first-search discovery order of the entry.

  long rev_discovered_;
  // Reverse depth-first-search discovery order of the entry.

  long fwd_finished_;
  // Forward depth-first-search completion order of the entry.

  long rev_finished_;
  // Reverse depth-first-search completion order of the entry.

  int is_thread_delineator_;
  // Flag identifying threads in the call graph.

  int has_unresolved_remote_dependencies_;
  // Flag indicating whether or not there are unresolved remote

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -