bpp-phyl3  3.0.0
DataFlow.h File Reference
#include <Bpp/Exceptions.h>
#include <cassert>
#include <cstddef>
#include <iostream>
#include <memory>
#include <sstream>
#include <string>
#include <typeinfo>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
+ Include dependency graph for DataFlow.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  bpp::Node_DF
 Base dataflow Node class. More...
 
class  bpp::Value< T >
 Abstract Node storing a value of type T. More...
 
class  bpp::Context
 Context for dataflow node construction. More...
 
struct  bpp::Context::CachedNodeRef
 NodeRef is hashable and comparable as a pointer. CachedNodeRef is hashable and comparable, by comparing the node configuration: More...
 
struct  bpp::Context::CachedNodeRefHash
 

Namespaces

 bpp
 Defines the basic types of data flow nodes.
 

Typedefs

using bpp::NodeRef = std::shared_ptr< Node_DF >
 
using bpp::NodeRefVec = std::vector< NodeRef >
 Alias for a dependency vector (of NodeRef). More...
 
template<typename T >
using bpp::ValueRef = std::shared_ptr< Value< T > >
 Shared pointer alias for Value<T>. More...
 

Enumerations

enum class  bpp::DotOptions { bpp::None = 0 , bpp::DetailedNodeInfo = 1 << 0 , bpp::FollowUpwardLinks = 1 << 1 , bpp::ShowDependencyIndex = 1 << 2 }
 
enum class  bpp::NumericalProperty { bpp::Constant , bpp::ConstantZero , bpp::ConstantOne , bpp::ConstantIdentity }
 Numerical properties for DF Node. More...
 

Functions

std::string bpp::prettyTypeName (const std::type_info &type_info)
 Debug: return a readable name for a C++ type descriptor (from typeid operator). More...
 
template<typename T >
void bpp::combineHash (std::size_t &seed, const T &t)
 Combine hashable value to a hash, from Boost library. More...
 
DotOptions bpp::operator| (DotOptions a, DotOptions b)
 
bool bpp::operator& (DotOptions a, DotOptions b)
 
void bpp::writeGraphToDot (std::ostream &os, const std::vector< const Node_DF * > &nodes, DotOptions opt=DotOptions::None)
 Write dataflow graph starting at nodes to output stream. More...
 
void bpp::writeGraphToDot (const std::string &filename, const std::vector< const Node_DF * > &nodes, DotOptions opt=DotOptions::None)
 Write dataflow graph starting at nodes to file at filename, overwriting it. More...
 
template<typename T >
std::string bpp::to_string_with_precision (const T a_value, const int n=6)
 Output with given precision. More...
 
template<typename T , typename U >
std::shared_ptr< T > bpp::convertRef (const std::shared_ptr< U > &from)
 Convert a node ref with runtime type check. More...
 
bool bpp::isTransitivelyDependentOn (const Node_DF &searchedDependency, const Node_DF &node)
 Check if searchedDependency if a transitive dependency of node. More...
 
NodeRef bpp::recreateWithSubstitution (Context &c, const NodeRef &node, const std::unordered_map< const Node_DF *, NodeRef > &substitutions)
 Recreate node by transitively replacing dependencies according to substitutions mapping. More...
 
template<typename T >
const T & bpp::accessValueConstCast (const Node_DF &node)
 
template<typename T >
std::shared_ptr< T > bpp::cachedAs (Context &c, std::shared_ptr< T > &&newNode)
 Helper: Same as Context::cached but with a shared_ptr<T> node. More...
 
template<typename T >
std::shared_ptr< T > bpp::cachedAs (Context &c, std::shared_ptr< T > &newNode)
 
Error functions (generate a message and throw exceptions).
void bpp::failureComputeWasCalled (const std::type_info &nodeType)
 
void bpp::failureNodeConversion (const std::type_info &handleType, const Node_DF &node)
 
void bpp::failureDependencyNumberMismatch (const std::type_info &contextNodeType, std::size_t expectedSize, std::size_t givenSize)
 
void bpp::failureEmptyDependency (const std::type_info &contextNodeType, std::size_t depIndex)
 
void bpp::failureDependencyTypeMismatch (const std::type_info &contextNodeType, std::size_t depIndex, const std::type_info &expectedType, const std::type_info &givenNodeType)
 
Basic dependency check primitives

Checks the size of a dependency vector, throws if mismatch.

void bpp::checkDependencyVectorSize (const std::type_info &contextNodeType, const NodeRefVec &deps, std::size_t expectedSize)
 
void bpp::checkDependencyVectorMinSize (const std::type_info &contextNodeType, const NodeRefVec &deps, std::size_t expectedMinSize)
 Checks the minimum size of a dependency vector, throws if mismatch. More...
 
void bpp::checkDependenciesNotNull (const std::type_info &contextNodeType, const NodeRefVec &deps)
 Checks that all dependencies are not null, throws if not. More...
 
void bpp::checkNthDependencyNotNull (const std::type_info &contextNodeType, const NodeRefVec &deps, std::size_t index)
 
template<typename T >
void bpp::checkNthDependencyIs (const std::type_info &contextNodeType, const NodeRefVec &deps, std::size_t index)
 Checks that deps[index] is a T node, throws if not. More...
 
template<typename T1 , typename T2 >
void bpp::checkNthDependencyIs (const std::type_info &contextNodeType, const NodeRefVec &deps, std::size_t index)
 Checks that deps[index] is a T1 or a T2 node, throws if not. More...
 
template<typename T >
void bpp::checkDependencyRangeIs (const std::type_info &contextNodeType, const NodeRefVec &deps, std::size_t start, std::size_t end)
 Check that deps[start, end[ contains T, throws if not. More...
 
template<typename T >
void bpp::checkNthDependencyIsValue (const std::type_info &contextNodeType, const NodeRefVec &deps, std::size_t index)
 Checks that deps[index] is a Value<T> node, throws if not. More...
 
template<typename T >
void bpp::checkDependencyRangeIsValue (const std::type_info &contextNodeType, const NodeRefVec &deps, std::size_t start, std::size_t end)
 Check that deps[start, end[ contains Value<T> nodes, throws if not. More...