cppthread 1.1.16
C++ Thread Library
item_with_predicate.cpp File Reference

Implementation & documentation of the item_with_predicate.h file. More...

#include "cppthread/item_with_predicate.h"
#include "cppthread/exception.h"
#include "cppthread/guard.h"
#include <iostream>
Include dependency graph for item_with_predicate.cpp:

Go to the source code of this file.

Detailed Description

The item_with_predicate.h file is a class which we implement and document here.

The class is used to add sets of items in a FIFO of a pool of workers, items which depend on each other. If a dependency is still defined, then the item is skipped (left in the FIFO) until the valid_workload() returns true, which happens once all the dependencies were worked on.

Note
We consider this base class as an example. Your own version of the valid_workload() function could use all sorts of predicates. For example, a workload may become valid only after a given date and time, when a file appears, etc.

Definition in file item_with_predicate.cpp.

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.