本文整理汇总了C++中States::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ States::push_back方法的具体用法?C++ States::push_back怎么用?C++ States::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类States
的用法示例。
在下文中一共展示了States::push_back方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
int
setVarsInformation (void)
{
Var::clearVarsInfo();
vector<string> labels;
YAP_Term labelsL = YAP_ARG1;
while (labelsL != YAP_TermNil()) {
YAP_Atom atom = YAP_AtomOfTerm (YAP_HeadOfTerm (labelsL));
labels.push_back ((char*) YAP_AtomName (atom));
labelsL = YAP_TailOfTerm (labelsL);
}
unsigned count = 0;
YAP_Term stateNamesL = YAP_ARG2;
while (stateNamesL != YAP_TermNil()) {
States states;
YAP_Term namesL = YAP_HeadOfTerm (stateNamesL);
while (namesL != YAP_TermNil()) {
YAP_Atom atom = YAP_AtomOfTerm (YAP_HeadOfTerm (namesL));
states.push_back ((char*) YAP_AtomName (atom));
namesL = YAP_TailOfTerm (namesL);
}
Var::addVarInfo (count, labels[count], states);
count ++;
stateNamesL = YAP_TailOfTerm (stateNamesL);
}
return TRUE;
}
示例2: advance_current_states
void Tracematch::advance_current_states(States& current_states, UINT32 symbol_id)
{
list<Vertex> next_states;
unordered_set<Vertex> visited_states;
OutEdgeIterator oei, oei_end;
list<Vertex>::iterator i = current_states.begin();
while (i != current_states.end()) {
if (visited_states.find(*i) == visited_states.end()) {
/* Unvisited state */
for (boost::tie(oei, oei_end) = boost::out_edges(*i, graph);
oei != oei_end; ++oei) {
/* Epsilon transition */
if (graph[*oei].symbol_id == SYMBOL_ID_EPSILON) {
current_states.push_back(boost::target(*oei, graph));
}
/* Match */
else if (graph[*oei].symbol_id == symbol_id) {
next_states.push_back(boost::target(*oei, graph));
}
}
visited_states.insert(*i);
}
/* Erase this element */
current_states.erase(i++);
}
current_states = next_states;
}
示例3: current_states_is_end
bool Tracematch::current_states_is_end(const States& current_states)
{
States states = current_states;
unordered_set<Vertex> visited_states;
OutEdgeIterator oei, oei_end;
list<Vertex>::iterator i = states.begin();
while (i != states.end()) {
if (visited_states.find(*i) == visited_states.end()) {
/* Unvisited state */
if (*i == graph_properties.end) {
return true;
}
for (boost::tie(oei, oei_end) = boost::out_edges(*i, graph); oei != oei_end; ++oei) {
/* Epsilon transition */
if (graph[*oei].symbol_id == SYMBOL_ID_EPSILON) {
states.push_back(boost::target(*oei, graph));
}
}
visited_states.insert(*i);
}
/* Erase this element */
states.erase(i++);
}
return false;
}
示例4: R82
void R82(std::vector<Dynamic>& __ret) {
//arguments
ptr<std::string> hllr__0 = ptr<std::string> (__ret.back()); __ret.pop_back();
Dynamic retval;
States x;
x.push_back(ptr<State>(StateNoise(*hllr__0)));
retval = x;
__ret.push_back(retval);
}
示例5: R81
void R81(std::vector<Dynamic>& __ret) {
//arguments
ptr<int> hllr__0 = ptr<int> (__ret.back()); __ret.pop_back();
Dynamic retval;
States x;
x.push_back(ptr<State>(StateSymbol(*hllr__0)));
retval = x;
__ret.push_back(retval);
}
示例6: R70
void R70(std::vector<Dynamic>& __ret) {
//arguments
Dynamic hllr__0 = Dynamic (__ret.back()); __ret.pop_back();
Dynamic retval;
States x;
x.push_back(ptr<State>(StateArgScope((States&)hllr__0)));
retval = x;
__ret.push_back(retval);
}
示例7: R27
void R27(std::vector<Dynamic>& __ret) {
//arguments
ptr<int> hllr__1 = ptr<int> (__ret.back()); __ret.pop_back();
Dynamic hllr__0 = __ret.back(); __ret.pop_back();
Dynamic retval;
States list;
list.push_back(ptr<State>(StateSymbol(*hllr__1)));
retval = StateMBrack(dMScopeBrack(list));
__ret.push_back(retval);
}