Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

ManagerImpl.hh

Go to the documentation of this file.
00001 /*
00002  * ManagerImpl.hh
00003  *
00004  * Copyright (c) 2003 The University of Utah and the Flux Group.
00005  * All rights reserved.
00006  *
00007  * This file is licensed under the terms of the GNU Public License.  
00008  * See the file "license.terms" for restrictions on redistribution 
00009  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
00010  */
00011 
00012 /**
00013  * @file ManagerImpl.hh
00014  *
00015  * Header file for the default implementation of the Broker::Manager interface.
00016  */
00017 
00018 #ifndef _manager_impl_hh
00019 #define _manager_impl_hh
00020 
00021 #include "BrokerS.h"
00022 
00023 #include <listNode.h>
00024 
00025 /**
00026  * A default implementation of the Broker::Manager interface.
00027  */
00028 class ManagerImpl : public virtual POA_Broker::Manager
00029 {
00030 
00031 public:
00032 
00033     /**
00034      * Construct a ManagerImpl.
00035      *
00036      * @param name The name of this manager.
00037      */
00038     ManagerImpl(const char *name);
00039 
00040     /**
00041      * Destruct a ManagerImpl.
00042      */
00043     virtual ~ManagerImpl();
00044 
00045     /** @copydoc Broker::Manager::CurrentPolicy */
00046     virtual Broker::Policy_ptr CurrentPolicy(void)
00047         throw (CORBA::SystemException);
00048     
00049     /** @copydoc Broker::Manager::CurrentPolicy */
00050     virtual void CurrentPolicy(Broker::Policy_ptr policy)
00051         throw (CORBA::SystemException);
00052 
00053     /** @copydoc Broker::Manager::AddTask */
00054     virtual void AddTask(Broker::Task_ptr task,
00055                          const Broker::ScheduleParameters &sp)
00056         throw (CORBA::SystemException,
00057                Broker::DuplicateScheduleParameter,
00058                Broker::InvalidScheduleParameter,
00059                Broker::MissingScheduleParameter);
00060 
00061     /** @copydoc Broker::Manager::RemoveTask */
00062     virtual void RemoveTask(Broker::Task_ptr task)
00063         throw (CORBA::SystemException);
00064 
00065     /** @copydoc Broker::Manager::GetTaskList */
00066     virtual Broker::TaskList *GetTaskList(void)
00067         throw (CORBA::SystemException);
00068 
00069     /** @copydoc Broker::Manager::ChangeTaskCPU */
00070     virtual void ChangeTaskCPU(Broker::RealTimeTask_ptr task,
00071                                CORBA::ULong ct,
00072                                CORBA::ULong status,
00073                                CORBA::ULong advice)
00074         throw (CORBA::SystemException, Broker::InvalidState);
00075 
00076     /**
00077      * Search of a task name in a Broker::TaskList.  Or, if the name is an IOR
00078      * return a reference to that object.
00079      *
00080      * @param orb A pointer to an active CORBA::ORB object.
00081      * @param tl The task list to search.
00082      * @param name The task name or task IOR.
00083      * @return An object reference that matches the given name or IOR.
00084      * @exception CORBA::BAD_PARAM if the task could not be found.
00085      */
00086     static Broker::Task_ptr ResolveTask(CORBA::ORB_ptr orb,
00087                                         Broker::TaskList &tl,
00088                                         const char *name)
00089         throw (CORBA::SystemException);
00090     
00091 private:
00092 
00093     /**
00094      * Repair the task list by removing any dead/unreachable objects.
00095      */
00096     void RepairTaskList(void);
00097 
00098     /**
00099      * Get the index of the given task in the mi_Tasks sequence.
00100      *
00101      * @param task The task object to look up.
00102      * @return The index of the given task in the mi_Tasks sequence or -1 if
00103      *         the task is not in the sequence.
00104      */
00105     int TaskIndex(Broker::Task_ptr task);
00106     
00107     /**
00108      * Remove a task object at a given index.
00109      *
00110      * @param index The index in mi_Tasks to remove.
00111      */
00112     void RemoveTaskAt(unsigned int index);
00113 
00114     /**
00115      * The active policy object or nil.
00116      */
00117     Broker::Policy_var mi_CurrentPolicy;
00118 
00119     /**
00120      * The list of tasks currently being managed.  This list will be passed
00121      * to policies when they are Broker::Policy::Activate()'d.
00122      */
00123     Broker::TaskList mi_Tasks;
00124     
00125 };
00126 
00127 #endif

Generated on Mon Dec 1 16:29:06 2003 for CPU Broker by doxygen 1.3.4