Functions
Pgrapher.cxx File Reference
#include "WireCellPgraph/Pgrapher.h"
#include "WireCellPgraph/Factory.h"
#include "WireCellIface/INode.h"
#include "WireCellUtil/NamedFactory.h"

Go to the source code of this file.

Functions

static std::pair< WireCell::INode::pointer, int > get_node (WireCell::Configuration jone)
 

Function Documentation

static std::pair<WireCell::INode::pointer, int> get_node ( WireCell::Configuration  jone)
static

Definition at line 21 of file Pgrapher.cxx.

22 {
23  using namespace WireCell;
24  std::string node = jone["node"].asString();
25 
26  // We should NOT be the one creating this component.
27  auto nptr = WireCell::Factory::find_maybe_tn<INode>(node);
28  if (!nptr) {
29  THROW(ValueError() << errmsg{"failed to get node"});
30  }
31 
32  int port = get(jone,"port",0);
33  return std::make_pair(nptr, port);
34 }
std::string string
Definition: nybbler.cc:12
boost::error_info< struct tag_errmsg, std::string > errmsg
Definition: Exceptions.h:54
#define THROW(e)
Definition: Exceptions.h:25
Thrown when a wrong value has been encountered.
Definition: Exceptions.h:37
Definition: Main.h:22