MUQ  0.4.3
IdentityPiece.cpp
Go to the documentation of this file.
2 
3 using namespace muq::Modeling;
4 
5 // Create a muq::Modeling::IdentityPiece with no fixed number of inputs and outputs and variable input/output types.
7 
8 // Create a muq::Modeling::IdentityPiece with fixed number of inputs/outputs and variable input/output types.
9 IdentityPiece::IdentityPiece(int const num) : WorkPiece(num, num) {}
10 
11 // Create a muq::Modeling::IdentityPiece with a fixed number of inputs/outputs with specified types
12 IdentityPiece::IdentityPiece(std::vector<std::string> const& types) : WorkPiece(types, types) {}
13 
14 // Create a muq::Modeling::IdentityPiece where some of the inputs/outputs have specified types
15 IdentityPiece::IdentityPiece(std::map<unsigned int, std::string> const& types) : WorkPiece(types, types) {}
16 
17 // Create a muq::Modeling::IdentityPiece where some of the inputs/outputs have specified types the number of inputs/outputs is fixed
18 IdentityPiece::IdentityPiece(std::map<unsigned int, std::string> const& types, unsigned int const num) : WorkPiece(types, num, types, num) {}
19 
21  // the number of outputs is the name as the number of inputs
22  outputs.resize(inputs.size());
23 
24  // copy the value of the inputs
25  for( unsigned int i=0; i<outputs.size(); ++i ) {
26  outputs[i] = inputs.at(i).get();
27  }
28 }
virtual void EvaluateImpl(muq::Modeling::ref_vector< boost::any > const &inputs) override
IdentityPiece()
Create a muq::Modeling::IdentityPiece with no fixed number of inputs and outputs and variable input/o...
Base class for MUQ's modelling envronment.
Definition: WorkPiece.h:40
std::vector< boost::any > outputs
The outputs.
Definition: WorkPiece.h:546
std::vector< std::reference_wrapper< const T > > ref_vector
A vector of references to something ...
Definition: WorkPiece.h:37