7 #ifndef VDJ_PIPE_VARIABLE_PATH_HPP_ 8 #define VDJ_PIPE_VARIABLE_PATH_HPP_ 10 #include "boost/foreach.hpp" 23 std::string
const& path,
24 std::vector<std::string>& tv,
25 std::vector<std::string>& nv
32 std::vector<std::string>
const& templ,
42 void init(std::string
const& path, std::vector<std::string>& nv0) {
43 std::vector<std::string> nv;
45 if( nv0.empty() ) nv0 = nv;
46 ids_.reserve(nv.size());
47 BOOST_FOREACH(std::string s, nv) {
48 std::vector<std::string>::const_iterator i =
49 std::find(nv0.begin(), nv0.end(), s);
50 if( i == nv0.end() ) BOOST_THROW_EXCEPTION(
55 ids_.push_back(Val_id(i - nv0.begin()));
63 vr.reserve(
ids_.size());
64 BOOST_FOREACH(
const Val_id
id,
ids_) {
65 vr.push_back(boost::cref(vals[
id()]));
72 std::size_t
size()
const {
return pt_.size();}
76 std::vector<std::string>
pt_;
Definition: variable_path.hpp:40
bool empty() const
Definition: variable_path.hpp:71
std::size_t size() const
Definition: variable_path.hpp:72
std::vector< Val_id > ids_
Definition: variable_path.hpp:75
std::vector< std::string > pt_
Definition: variable_path.hpp:76
std::string operator()() const
Definition: variable_path.hpp:70
std::string operator()(detail::Queable_ofstream_types::val_vector const &vals) const
Definition: variable_path.hpp:59
Main namespace of vdj_pipe library.
Definition: keywords_variable.hpp:11
void path_decompose(std::string const &path, std::vector< std::string > &tv, std::vector< std::string > &nv)
separate path into non-name and name areas
Definition: variable_path.cpp:18
void init(std::string const &path, std::vector< std::string > &nv0)
Definition: variable_path.hpp:42
#define VDJ_PIPE_DECL
Definition: config.hpp:23
std::vector< value_type > val_vector
Definition: queable_ofstream_types.hpp:20
boost::error_info< struct errinfo_str1_, std::string > str1_t
Definition: exception.hpp:25
Definition: exception.hpp:23
boost::error_info< struct errinfo_message_, std::string > msg_t
Definition: exception.hpp:24
Definition: variable_path.hpp:38
std::vector< boost::reference_wrapper< value_type const > > val_ref_vector
Definition: queable_ofstream_types.hpp:23
std::string path_assemble(std::vector< std::string > const &templ, detail::Queable_ofstream_types::val_ref_vector const &vals)
assemble path from template and values
Definition: variable_path.cpp:69