RaftLib  0.3a
C++ Stream Processing Template Library
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Allocate Class Referenceabstract
Inheritance diagram for Allocate:
[legend]
Collaboration diagram for Allocate:
[legend]

Public Member Functions

 Allocate (Map &map, volatile bool &exit_alloc)
 
virtual ~Allocate ()
 
virtual void run ()=0
 
void waitTillReady ()
 

Protected Member Functions

void initialize (PortInfo *src, PortInfo *dst, FIFO *fifo)
 
void setReady ()
 

Protected Attributes

std::set< raft::kernel * > & source_kernels
 
std::set< raft::kernel * > & all_kernels
 
std::set< FIFO * > allocated_fifo
 
volatile bool & exit_alloc
 

Constructor & Destructor Documentation

Allocate::Allocate ( Map map,
volatile bool &  exit_alloc 
)

Allocate - base constructor, really doesn't do too much save for setting the global variables all_kernels and source_kernels from the Map object.

Parameters
map- Map&
exit_alloc- bool used to terminate loop, for monitoring allocations, controlled by map object.

allocate.cpp -

Author
: Jonathan Beard
Version
: Tue Sep 16 20:20:06 2014

Copyright 2014 Jonathan Beard

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Allocate::~Allocate ( )
virtual

destructor

Member Function Documentation

void Allocate::initialize ( PortInfo src,
PortInfo dst,
FIFO fifo 
)
protected

initialize - internal method to be used within the run method takes care of the initialization using the already allocated FIFO object passed as a param. This function will throw an exception if either port (src or dst) have already been allocated.

Parameters
src- PortInfo*, nullptr if not to be set
dst- PortInfo*, nullptr if not to be set
fifo- FIFO*
Exceptions
PortDoubleInitializeException- if either port is already initialized.

NOTE: this list simply speeds up the monitoring if we want it

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void Allocate::run ( )
pure virtual

run - implement this function to create a new allocator, will be run inside a thread so exits when done but if run-time monitoring is desired then this is the place to do it.

Implemented in stdalloc, and dynalloc.

void Allocate::setReady ( )
protected

setReady - call within the implemented run function to signal that the initial allocations have been completed.

Here is the caller graph for this function:

void Allocate::waitTillReady ( )

waitTillReady - call after initializing the allocate thread, returns when the initial allocation is complete.

Member Data Documentation

std::set< FIFO* > Allocate::allocated_fifo
protected

keeps a list of all currently allocated FIFO objects, set from within the initialize function.

volatile bool& Allocate::exit_alloc
protected

exit_alloc - bool whose value is set by the map object, controls when the loop within the alloc thread is exited.

std::set< raft::kernel* >& Allocate::source_kernels
protected

both convenience structs, hold exactly what the names say


The documentation for this class was generated from the following files: