RaftLib  0.3a
C++ Stream Processing Template Library
Public Member Functions | Friends | List of all members
KernelContainer Class Reference

#include <kernelcontainer.hpp>

Public Member Functions

 KernelContainer ()
 
auto size () -> decltype(list.size())
 
bool removeKernel (raft::kernel *kernel)
 
void addKernel (raft::kernel *kernel)
 
auto begin () -> KernelIterator< decltype(list.begin()) >
 
auto end () -> KernelIterator< decltype(list.end()) >
 
void lock ()
 
void unlock ()
 
void clear ()
 

Friends

class KernelIterator< decltype(list.begin()) >
 

Detailed Description

kernelcontainer.hpp - simple container with lockable iterators for use with raft::kernel objects.

Author
: Jonathan Beard
Version
: Wed Jan 14 08:12:47 2015

Copyright 2015 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.

Constructor & Destructor Documentation

KernelContainer::KernelContainer ( )

Contstructor for a container for raft::kernel objects

kernelcontainer.cpp -

Author
: Jonathan Beard
Version
: Wed Jan 14 08:12:47 2015

Copyright 2015 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.

Member Function Documentation

void KernelContainer::addKernel ( raft::kernel kernel)

addKernel - add a kernel to this container. Gains a lock before committing the kernel to the data structure.

Parameters
raft::kernel*,kernelto be added
auto KernelContainer::begin ( ) -> KernelIterator< decltype( list.begin() ) >

begin - returns an iterator to the first kernel in the list, future behavior might produce a priority type ordering, but this should be handled by the iterator and its sub-classes. Iterator is thread safe!

Returns
KernelIterator
auto KernelContainer::end ( ) -> KernelIterator< decltype( list.end() ) >

end - returns an iterator to one past the last kernel in the list, this cannot be relied upon to be the last element since the iterator does not define a – operator, so really it can just be used for detecting when all the kernels have been iterated through.

Returns
KernelIterator
bool KernelContainer::removeKernel ( raft::kernel kernel)

removeKernel - call to remove the kernel specified as the param, which must not be null. The function first gains a lock on the list then proceeds to remove it.

Parameters
kernel- raft::kernel const *
Returns
bool, true if removed, false otherwise
auto KernelContainer::size ( ) -> decltype( list.size() )

size - return the number of kernels currently assigned

Returns
std::size_t

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