本文整理汇总了C++中HelloWorld类的典型用法代码示例。如果您正苦于以下问题:C++ HelloWorld类的具体用法?C++ HelloWorld怎么用?C++ HelloWorld使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HelloWorld类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: New
static Handle<Value> New(const Arguments& args)
{
HandleScope scope;
HelloWorld* hw = new HelloWorld();
hw->Wrap(args.This());
return args.This();
}
示例2: main
int main() {
HelloWorld hw;
hw.communicate();
system("PAUSE");
return 0;
}
示例3:
void TestScene3::doClose(Ref* sender)
{
HelloWorld* hello;
auto scene = HelloWorld::createScene();
Director::getInstance()->replaceScene(hello->createTransition( 1, scene));
}
示例4: lock
void PubSubKeepAllTransientReader::read(uint16_t lastvalue, const std::chrono::seconds &seconds)
{
std::unique_lock<std::mutex> lock(mutex_);
lastvalue_ = lastvalue;
while(!msgs_.empty() && lastvalue_ == *msgs_.rbegin())
{
if(data_received_)
{
HelloWorld hello;
SampleInfo_t info;
if(subscriber_->takeNextData((void*)&hello, &info))
{
if(info.sampleKind == ALIVE)
{
newNumber(hello.index());
}
}
--data_received_;
}
else
{
if(cv_.wait_for(lock, seconds) == std::cv_status::timeout)
break;
}
}
}
示例5: main
int main(int argc, char* argv[])
{
std::cout << "Hello world, I'm the main thread, tid=" << pthread_self() << std::endl;
HelloWorld hello;
hello.start();
return 0;
}
示例6: TEST
TEST(HelloWorld, sum) {
HelloWorld hello;
int result = hello.sum(2, 3);
EXPECT_EQ(result, 5);
}
示例7: execute
virtual bool execute(Event* e,Object* data){
CCScene* scene = CCScene::create();
HelloWorld* hw = HelloWorld::create();
scene->addChild(hw);
hw->setManager(getSector()->getManager());
CCDirector::sharedDirector()->replaceScene(scene);
return true;
};
示例8: _tmain
int _tmain(int argc, _TCHAR* argv[])
{
HelloWorld hw;
hw.SayThis(L"I'm a native client");
return 0;
}
示例9: main
int main (int argc, char **argv) {
HelloWorld hello;
// The first 3 parameters are identical to the fuse_main function.
// The last parameter gives a pointer to a class instance, which is
// required for static methods to access instance variables/ methods.
return hello.main (argc, argv, NULL, &hello);
}
示例10: main
int main()
{
// Lets Greet the World!
HelloWorld GreetMe;
GreetMe.SayHello();
system("pause");
return 0;
}
示例11: showmsg
void FrontCoverLayer::showmsg(const char *msg)
{
CCNode* parent = this->getParent();
HelloWorld* helloworld = dynamic_cast<HelloWorld*>(parent);
if(helloworld)
{
helloworld->showMessage(msg);
}
}
示例12: shoot
void Projectile::shoot(float dt){
//CCLog("[Enemy] shoot");
Vec2 p = this->getPosition();
p.x = p.x - this->getContentSize().width / 2;
p.y = p.y - this->getContentSize().height * 0.05;
HelloWorld* helloWorld = (HelloWorld*) this->getParent();
helloWorld->shoot(p);
}
示例13: deserialize
bool HelloWorldType::deserialize(SerializedPayload_t* payload, void* data)
{
HelloWorld* hw = (HelloWorld*) data;
// Object that manages the raw buffer.
eprosima::fastcdr::FastBuffer fastbuffer((char*)payload->data, payload->length);
// Object that serializes the data.
eprosima::fastcdr::Cdr deser(fastbuffer);
//serialize the object:
hw->deserialize(deser);
return true;
}
示例14: HelloWorld
HelloWorld* HelloWorld::create(PhysicsWorld* world,int level)
{
HelloWorld* pRet = new HelloWorld();
if (pRet && pRet->init(world,level)){
pRet->autorelease();
return pRet;
}
delete pRet;
pRet = NULL;
return NULL;
}
示例15: waitDiscovery
void ReqRepHelloWorldReplier::newNumber(SampleIdentity sample_identity, uint16_t number)
{
waitDiscovery();
WriteParams wparams;
HelloWorld hello;
hello.index(number);
hello.message("GoodBye");
wparams.related_sample_identity(sample_identity);
ASSERT_EQ(reply_publisher_->write((void*)&hello, wparams), true);
}