本文整理汇总了C++中Operand::GetTimeRange方法的典型用法代码示例。如果您正苦于以下问题:C++ Operand::GetTimeRange方法的具体用法?C++ Operand::GetTimeRange怎么用?C++ Operand::GetTimeRange使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Operand
的用法示例。
在下文中一共展示了Operand::GetTimeRange方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Operand
Operand (const Operand &cp) {
action = cp.GetAction();
variable = cp.GetVariable();
time = cp.GetTime();
location = cp.GetLocation();
if (cp.GetTimeRange() != NULL) {
time_range = new string[2];
time_range[0] = cp.GetTimeRange()[0];
time_range[1] = cp.GetTimeRange()[1];
} else
time_range = NULL;
if (cp.GetNodeRange() != NULL) {
node_range = new string[2];
node_range[0] = cp.GetNodeRange()[0];
node_range[1] = cp.GetNodeRange()[1];
} else
node_range = NULL;
}
示例2: FixMissingEntriesAndFillTheBucket
bool FixMissingEntriesAndFillTheBucket(queue<Operand*> &ods, stack<string> &bucket) {
//Fix missing entries
queue<Operand*> temp;
register bool inside = 0;
temp = ods;
while (ods.size() != 1)
ods.pop();
Operand *tmpod = new Operand(*(ods.front()));
string *rt = tmpod->GetTimeRange();
string *rl = tmpod->GetNodeRange();
string tact = tmpod->GetAction();
string rtime = tmpod->GetTime();
string rloc = tmpod->GetLocation();
ods = temp;
//pop entire queue
string when = BlankSpace, loc = BlankSpace;
while (ods.size() != 0) {
when = BlankSpace, loc = BlankSpace;
Operand *t = new Operand(*(ods.front()));
when.append(t->GetTime());when.append(BlankSpace);
loc.append(t->GetLocation()); loc.append(BlankSpace);
if (t->GetTimeRange() == NULL) {
t->SetTimeRange(rt);
}
if (t->GetNodeRange() == NULL)
t->SetNodeRange(rl);
if (t->GetAction() == DefaultAction)
t->SetAction(tact);
if (t->GetTime() == DefaultWhen)
t->SetTime(rtime);
if (t->GetLocation() == DefaultLocation)
t->SetLocation(rloc);
if (t->GetTimeRange() != NULL) {
when.append(t->GetTimeRange()[0]);
if (t->GetTimeRange()[1] != EmptyString) {
when.append(ToKeyword);
when.append(t->GetTimeRange()[1]);
}
} else {
when.append(DefaultWhenValue);
}
if (t->GetNodeRange() != NULL) {
loc.append(t->GetNodeRange()[0]);
if (t->GetNodeRange()[1] != EmptyString) {
loc.append(ToKeyword);
loc.append(t->GetNodeRange()[1]);
}
} else {
loc.append(DefaultLocationValue);
}
if ((t->GetVariable() != DefaultComponent) || (t->GetAction() != DefaultAction)) {
inside = 1;
bucket.push(BlankSpace);
bucket.push(when);
bucket.push(loc);
bucket.push(t->GetAction());
bucket.push(BlankSpace);
bucket.push(t->GetVariable());
}
ods.pop();
}
return inside;
}