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

Public Member Functions

 MapBase ()
 
virtual ~MapBase ()
 
template<order::spec t = order::in>
kernel_pair_t link (raft::kernel *a, raft::kernel *b, const std::size_t buffer=0)
 
template<order::spec t = order::in>
kernel_pair_t link (raft::kernel *a, const std::string a_port, raft::kernel *b, const std::size_t buffer=0)
 
template<order::spec t = order::in>
kernel_pair_t link (raft::kernel *a, raft::kernel *b, const std::string b_port, const std::size_t buffer=0)
 
template<order::spec t = order::in>
kernel_pair_t link (raft::kernel *a, const std::string a_port, raft::kernel *b, const std::string b_port, const std::size_t buffer=0)
 

Static Protected Member Functions

static void join (raft::kernel &a, const std::string name_a, PortInfo &a_info, raft::kernel &b, const std::string name_b, PortInfo &b_info)
 
static void insert (raft::kernel *a, PortInfo &a_out, raft::kernel *b, PortInfo &b_in, raft::kernel *i)
 

Protected Attributes

kernelkeeper source_kernels
 
kernelkeeper dst_kernels
 
kernelkeeper all_kernels
 
std::vector< MapBase * > sub_maps
 

Friends

class Map
 

Constructor & Destructor Documentation

MapBase::MapBase ( )

MapBase - constructor, really doesn't do too much at the monent and doesn't really need to.

mapbase.cpp -

Author
: Jonathan Beard
Version
: Fri Sep 12 10:28:33 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.

MapBase::~MapBase ( )
virtual

default destructor

Member Function Documentation

void MapBase::join ( raft::kernel a,
const std::string  name_a,
PortInfo a_info,
raft::kernel b,
const std::string  name_b,
PortInfo b_info 
)
staticprotected

join - helper method joins the two ports given the correct information. Essentially the correct information for the PortInfo object is set. Type is also checked using the typeid information. If the types aren't the same then an exception is thrown.

Parameters
a- raft::kernel&
name_a- name for the port on kernel a
a_info- PortInfo struct for kernel a
b- raft::kernel&
name_b- name for port on kernel b
b_info- PortInfo struct for kernel b
Exceptions
PortTypeMismatchException

Here is the call graph for this function:

Here is the caller graph for this function:

template<order::spec t = order::in>
kernel_pair_t MapBase::link ( raft::kernel a,
raft::kernel b,
const std::size_t  buffer = 0 
)
inline

link - this comment goes for the next 4 types of link functions, which basically do the exact same thing. The template function takes a single param order::spec which is exactly as the name implies, the order of the queue linking the two kernels. The various functions are needed to specify different ordering types each of these will be commented separately below. This function assumes that Kernel 'a' has only a single output and raft::kernel 'b' has only a single input otherwise an exception will be thrown.

Parameters
a- raft::kernel*, src kernel
b- raft::kernel*, dst kernel
Exceptions
AmbiguousPortAssignmentException- thrown if either src or dst have more than a single port to link.
Returns
kernel_pair_t - references to src, dst kernels.

assume each only has a single input / output

Here is the call graph for this function:

template<order::spec t = order::in>
kernel_pair_t MapBase::link ( raft::kernel a,
const std::string  a_port,
raft::kernel b,
const std::size_t  buffer = 0 
)
inline

link - same as function above save for the following differences: kernel a is assumed to have multiple ports and the one we wish to link with raft::kernel b is a_port. raft::kernel b is assumed to have a single input port to connect otherwise an exception is thrown.

Parameters
a- raft::kernel *a, can have multiple ports
a_port- port within raft::kernel a to link
b- raft::kernel *b, assumed to have only single input.
Exceptions
AmbiguousPortAssignmentException- thrown if raft::kernel b has more than a single input port.
PortNotFoundException- thrown if raft::kernel a has no port named a_port.
Returns
kernel_pair_t - references to src, dst kernels.

Here is the call graph for this function:

template<order::spec t = order::in>
kernel_pair_t MapBase::link ( raft::kernel a,
raft::kernel b,
const std::string  b_port,
const std::size_t  buffer = 0 
)
inline

link - same as above save for the following differences: raft::kernel a is assumed to have a single output port. raft::kernel b is assumed to have more than one input port, within one matching the port b_port.

Parameters
a- raft::kernel*, with more a single output port
b- raft::kernel*, with input port named b_port
b_port- const std::string, input port name.
Exceptions
AmbiguousPortAssignmentException- exception thrown if raft::kernel a has more than a single output port
PortNotFoundException- exception thrown if raft::kernel b has no input port named b_port
Returns
kernel_pair_t - references to src, dst kernels.

Here is the call graph for this function:

template<order::spec t = order::in>
kernel_pair_t MapBase::link ( raft::kernel a,
const std::string  a_port,
raft::kernel b,
const std::string  b_port,
const std::size_t  buffer = 0 
)
inline

link - same as above save for the following differences: raft::kernel a is assumed to have an output port a_port and raft::kernel b is assumed to have an input port b_port.

Parameters
a- raft::kernel*, with more a single output port
a_port- const std::string, output port name
b- raft::kernel*, with input port named b_port
b_port- const std::string, input port name.
Exceptions
PortNotFoundException- exception thrown if either kernel is missing port a_port or b_port.
Returns
kernel_pair_t - references to src, dst kernels.

Here is the call graph for this function:

Member Data Documentation

kernelkeeper MapBase::all_kernels
protected

and keep a list of all kernels

kernelkeeper MapBase::dst_kernels
protected

dst kernels

kernelkeeper MapBase::source_kernels
protected

need to keep source kernels

std::vector< MapBase* > MapBase::sub_maps
protected

FIXME: come up with better solution for enabling online duplication of submaps as a unit.

DOES: flatten these kernels into main map once we run


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