RaftLib
0.3a
C++ Stream Processing Template Library
|
#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()) > |
kernelcontainer.hpp - simple container with lockable iterators for use with raft::kernel objects.
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.
KernelContainer::KernelContainer | ( | ) |
Contstructor for a container for raft::kernel objects
kernelcontainer.cpp -
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.
void KernelContainer::addKernel | ( | raft::kernel * | kernel | ) |
addKernel - add a kernel to this container. Gains a lock before committing the kernel to the data structure.
raft::kernel*,kernel | to 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!
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.
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.
kernel | - raft::kernel const * |
auto KernelContainer::size | ( | ) | -> decltype( list.size() ) |
size - return the number of kernels currently assigned