本文整理汇总了C++中Activity::time_start方法的典型用法代码示例。如果您正苦于以下问题:C++ Activity::time_start方法的具体用法?C++ Activity::time_start怎么用?C++ Activity::time_start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Activity
的用法示例。
在下文中一共展示了Activity::time_start方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: activity_test
void activity_test()
{
BufferConverter c;
UniqueComponentActivityID ucaid = 10;
Timestamp time_start = 20, time_end = 30;
uint32_t nid = 40, pid = 50, time = 60, aid = 70;
uint16_t cid = 80;
ProcessID proc = { nid, pid, time };
ComponentID comp = { proc, cid };
ActivityID actid = { comp, aid };
ActivityError error = 404;
RemoteCallIdentifier *remote_invoker = NULL;
ProcessID proc2 = { 110, 210, 310 };
ComponentID comp2 = { proc2, 410 };
ActivityID actid2 = { comp2, 510 };
ProcessID proc3 = { 120, 220, 320 };
ComponentID comp3 = { proc3, 420 };
ActivityID actid3 = { comp3, 520 };
vector<ActivityID> parents;
parents.push_back (actid2);
parents.push_back (actid3);
const std::string str1 = "klingon functions don't have parameters, they have arguments, and always win them!";
const AttributeValue value1 (str1);
const Attribute attr1 (100, value1);
const AttributeValue value2 (42);
const Attribute attr2 (101, value2);
vector<Attribute> attributes;
attributes.push_back (attr1);
attributes.push_back (attr2);
const RemoteCallIdentifier target1 (5, 10, 15);
const RemoteCallIdentifier target2 (10, 20, 30);
const std::string str3 = "all your base are belong to us";
const AttributeValue value3 (str3);
const Attribute attr3 (100, value3);
const AttributeValue value4 (42);
const Attribute attr4 (103, value4);
attributes.push_back (attr4);
vector<Attribute> attributes2;
vector<Attribute> attributes3;
attributes2.push_back (attr3);
attributes2.push_back (attr4);
RemoteCall rc1 = { target1, attributes2 };
RemoteCall rc2 = { target1, attributes3 };
vector<RemoteCall> remote_calls;
remote_calls.push_back (rc1);
remote_calls.push_back (rc2);
Activity act (ucaid, time_start, time_end, actid, parents,
attributes, remote_calls, remote_invoker, error);
buffers::Activity bact;
c.activity (act, bact);
if (act.ucaid() != bact.ucaid())
util::fail("Activity-UCAID");
if (act.time_start() != bact.time_start())
util::fail("Activity-TIME-START");
if (act.time_stop() != bact.time_stop())
util::fail("Activity-TIME-STOP");
if (act.errorValue() != bact.error_value())
util::fail("Activity-ERROR-VALUE");
if (act.aid().id != bact.aid().id())
util::fail("Activity-ID");
if (act.aid().cid.id != bact.aid().cid().id())
util::fail("Activity-CID");
if (act.aid().cid.pid.nid != bact.aid().cid().pid().nid())
util::fail("Activity-NID");
if (act.aid().cid.pid.pid != bact.aid().cid().pid().pid())
util::fail("Activity-PID");
if (act.aid().cid.pid.time != bact.aid().cid().pid().time())
util::fail("Activity-TIME");
if (act.parentArray().size() != (unsigned) bact.parents_size())
util::fail("Different parent count.");
for (vector<ActivityID>::const_iterator i = act.parentArray().begin();
i < act.parentArray().end(); i++) {
buffers::ActivityID aid1;
c.aid (*i, aid1);
bool found = false;
for (int j = 0; j < bact.parents_size(); j++) {
//.........这里部分代码省略.........