本文整理汇总了C++中Count类的典型用法代码示例。如果您正苦于以下问题:C++ Count类的具体用法?C++ Count怎么用?C++ Count使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Count类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
QString
CountLookup::lookupById(Id count_id)
{
Count count;
if (count_id != INVALID_ID && _quasar->db()->lookup(count_id, count))
return count.number();
return "";
}
示例2: main
int main()
{
Count C;
++C;
++C;
++C;
C.display();
}
示例3: main
int main()
{
Count counter;
cout << "counter.x after instantiation: ";
counter.display();
cout << "counter.x after call to friend function setX():";
setX(counter, 8);
counter.display();
}
示例4: sizeof
void SseProxy::beginSendingCandidateResults(const Count &count, int activityId)
{
cout << "SseProxy: beginSendingCandidateResults" << endl;
DxMessageCode code = BEGIN_SENDING_CANDIDATE_RESULTS;
int dataLength = sizeof(Count);
Count marshall = count;
marshall.marshall();
sendMessage(code, activityId, dataLength, &marshall);
}
示例5: main
int main()
{
Count counter; // create Count object
cout << "counter.x after instantiation: ";
counter.print();
setX( counter, 8 ); // set x using a friend function
cout << "counter.x after call to setX friend function: ";
counter.print();
} // end main
示例6: main
int main() {
Count counter;
counter.print();
setX(counter, 8);
counter.print();
return 0;
}
示例7: main
int main(int argc, const char *argv[]) {
Count counter;
std::cout << "counter.x after instantiation: ";
counter.print();
setX(counter, 8);
std::cout << "counter.x after call to setX friend function: ";
counter.print();
return 0;
}
示例8: main
int main()
{
Count counter; // create counter object
Count *counterPtr = &counter; // create pointer to counter
Count &counterRef = counter; // create reference to counter
cout << "Assign 1 to x and print using the object's name: ";
counter.x = 1; // assign 1 to data member x
counter.print(); // call member function print
cout << "Assign 2 to x and print using a reference: ";
counterRef.x = 2; // assign 2 to data member x
counterRef.print(); // call member function print
cout << "Assign 3 to x and print using a pointer: ";
counterPtr->x = 3; // assign 3 to data member x
counterPtr->print(); // call member function print
return 0;
} // end main
示例9: main
int main(int argc, const char * argv[])
{
Count counter;
Count *counterPtr=&counter;
Count &counterRef = counter;
cout<<"Set counter to 1..\n";
counter.setX(1);
counter.print();
cout<<"Set counter Ref to 2..\n";
counterRef.setX(2);
counter.print();
cout<<"Set counter Ptr to 3..\n";
counterPtr->setX(3);
counterPtr->print();
return 0;
}
示例10: main
int main(int argc, char *argv[]) {
Network yarp;
Count counter;
StressPublisher pubs[N];
StressSubscriber subs[N];
for (int i=0; i<N; i++) {
pubs[i].n = i;
subs[i].n = i;
pubs[i].counter = &counter;
subs[i].counter = &counter;
pubs[i].start();
subs[i].start();
}
printf("Started.....\n");
for (int i=0; i<N; i++) {
pubs[i].stop();
}
printf("Stopping.\n");
for (int i=0; i<N; i++) {
subs[i].stop();
}
counter.show();
for (int i=0; i<N; i++) {
for (int j=0; j<N; j++) {
if (!NetworkBase::isConnected(pubs[i].p.getName(),
subs[i].p.getName())) {
printf(" *** failed to connect %s -> %s\n",
pubs[i].p.getName().c_str(),
subs[i].p.getName().c_str());
}
}
}
return 0;
}
示例11: main
int main() {
Count a;
a.Show();
{
Count b;
a.Show();
b.Show();
}
a.Show();
}
示例12: main
int main(){
Count a;
a.Show();
// local scope
{
Count b;
a.Show();
b.Show();
}
a.Show();
}
示例13: main
int main(int argc, char **argv) {
Count counter;
Count *counterPtr = &counter;
Count &counterRef = counter;
counter.setX(1);
counter.print();
counterPtr->setX(2);
counterPtr->print();
counterRef.setX(3);
counterRef.print();
counter.print();
}
示例14: hashCode
size_t hashCode(Count const& count) const {
return count.hash();
}
示例15: canGive
bool Player::canGive(const Count<const Transferable *> & types) const {
Count<const Transferable *>::const_iterator itr;
for (itr = types.begin(); itr != types.end(); ++itr)
if (!canGive(itr->first, itr->second)) return false;
return true;
}