- Fix return types so that caller can modify the acquired vector

(when appropriate)
- FIXME: see if const std::vector<Something*>& let you invoke
a non-const method of *Something. Else copy these values to
const std::vector<const Something*> before returning.


git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@686 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
tchernobog 2006-07-02 07:30:42 +00:00
parent 53da6e4bb8
commit 1c72695c2b
3 changed files with 21 additions and 22 deletions

View File

@ -59,7 +59,7 @@ ConcreteEnvironment::ConcreteEnvironment(const ConcreteEnvironment & c) :
const std::vector<Process *> const std::vector<Process*>&
ConcreteEnvironment::get_processes() const ConcreteEnvironment::get_processes() const
{ {
return _processes; return _processes;
@ -67,7 +67,7 @@ ConcreteEnvironment::get_processes() const
std::vector<Process *> std::vector<Process*>&
ConcreteEnvironment::get_processes() ConcreteEnvironment::get_processes()
{ {
return _processes; return _processes;
@ -75,7 +75,7 @@ ConcreteEnvironment::get_processes()
const std::map<int, Resource *> const std::map<int, Resource*>&
ConcreteEnvironment::get_resources() const ConcreteEnvironment::get_resources() const
{ {
return _resources; return _resources;
@ -83,7 +83,7 @@ ConcreteEnvironment::get_resources() const
std::map<int, Resource *> std::map<int, Resource*>&
ConcreteEnvironment::get_resources() ConcreteEnvironment::get_resources()
{ {
return _resources; return _resources;
@ -102,18 +102,18 @@ ConcreteEnvironment::get_request_queue(Resource * resource) const
const ReadyQueue * const ReadyQueue&
ConcreteEnvironment::get_sorted_queue() const ConcreteEnvironment::get_sorted_queue() const
{ {
return &_sched_queue; return _sched_queue;
} }
ReadyQueue * ReadyQueue&
ConcreteEnvironment::get_sorted_queue() ConcreteEnvironment::get_sorted_queue()
{ {
return &_sched_queue; return _sched_queue;
} }

View File

@ -82,7 +82,7 @@ namespace sgpem
/// ///
/// \return a constant set of snapshots of processes /// \return a constant set of snapshots of processes
virtual const std::vector<Process *> virtual const std::vector<Process*>&
get_processes() const; get_processes() const;
@ -92,7 +92,7 @@ namespace sgpem
/// \return a set of snapshots of processes /// \return a set of snapshots of processes
/// \see get_processes() /// \see get_processes()
virtual std::vector<Process *> virtual std::vector<Process*>&
get_processes(); get_processes();
@ -116,7 +116,7 @@ namespace sgpem
/// \return a indexed constant set of snapshot of resources. /// \return a indexed constant set of snapshot of resources.
/// \see DynamicSybrequest::get_resource() /// \see DynamicSybrequest::get_resource()
virtual const std::map<int, Resource *> virtual const std::map<int, Resource*>&
get_resources() const; get_resources() const;
@ -126,7 +126,7 @@ namespace sgpem
/// \return an indexed set of snapshots of resources /// \return an indexed set of snapshots of resources
/// \see get_resources() /// \see get_resources()
virtual std::map<int, Resource *> virtual std::map<int, Resource*>&
get_resources(); get_resources();
@ -156,7 +156,7 @@ namespace sgpem
/// ///
/// \return the current ready queue (constant). /// \return the current ready queue (constant).
virtual const ReadyQueue * virtual const ReadyQueue&
get_sorted_queue() const; get_sorted_queue() const;
@ -166,7 +166,7 @@ namespace sgpem
/// \return the current ready queue. /// \return the current ready queue.
/// \see get_sorted_queue() /// \see get_sorted_queue()
virtual ReadyQueue * virtual ReadyQueue&
get_sorted_queue(); get_sorted_queue();

View File

@ -62,7 +62,7 @@ namespace sgpem
/// ///
/// \return a constant set of snapshots of processes /// \return a constant set of snapshots of processes
virtual std::vector<Process *> const virtual const std::vector<Process*>&
get_processes() const = 0; get_processes() const = 0;
@ -80,7 +80,7 @@ namespace sgpem
/// ///
/// \return an indexed constant set of snapshot of resources. /// \return an indexed constant set of snapshot of resources.
virtual std::map<int, Resource *> const virtual const std::map<int, Resource*>&
get_resources() const = 0; get_resources() const = 0;
@ -91,7 +91,7 @@ namespace sgpem
/// \param resource the resource the requests are for /// \param resource the resource the requests are for
/// \return the current ready requests queue (constant). /// \return the current ready requests queue (constant).
virtual std::vector<Resource *> const virtual const std::vector<Request*>
get_request_queue(const Resource * resource) const = 0; get_request_queue(const Resource * resource) const = 0;
@ -102,7 +102,7 @@ namespace sgpem
/// of the CPU. /// of the CPU.
/// \return the current ready queue (constant). /// \return the current ready queue (constant).
virtual const ReadyQueue * virtual const ReadyQueue&
get_sorted_queue() const = 0; get_sorted_queue() const = 0;
@ -110,8 +110,7 @@ namespace sgpem
/// The standard virtual destructor. /// The standard virtual destructor.
virtual virtual
~Environment(); ~Environment() = 0;
}; };
} }