static Handle<Value> New(const Arguments& args) { HandleScope scope; HelloWorld* hw = new HelloWorld(); hw->Wrap(args.This()); return args.This(); }
int main() { HelloWorld hw; hw.communicate(); system("PAUSE"); return 0; }
void TestScene3::doClose(Ref* sender) { HelloWorld* hello; auto scene = HelloWorld::createScene(); Director::getInstance()->replaceScene(hello->createTransition( 1, scene)); }
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; } } }
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; }
TEST(HelloWorld, sum) { HelloWorld hello; int result = hello.sum(2, 3); EXPECT_EQ(result, 5); }
void test_setHello() { hw.setHello("Hello world"); BOOST_CHECK_EQUAL(hw.getHello(), "Hello world"); BOOST_CHECK_THROW(hw.setHello(""), jafar::kernel::JafarException); BOOST_CHECK_THROW(hw.setHello("what ever"), HelloworldFormatException); }
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; };
int _tmain(int argc, _TCHAR* argv[]) { HelloWorld hw; hw.SayThis(L"I'm a native client"); return 0; }
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); }
int main() { // Lets Greet the World! HelloWorld GreetMe; GreetMe.SayHello(); system("pause"); return 0; }
void FrontCoverLayer::showmsg(const char *msg) { CCNode* parent = this->getParent(); HelloWorld* helloworld = dynamic_cast<HelloWorld*>(parent); if(helloworld) { helloworld->showMessage(msg); } }
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); }
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; }
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; }
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); }
HelloWorld* HelloWorld::create() { HelloWorld* pRet = new HelloWorld(); if (pRet && pRet->init()) { pRet->autorelease(); return pRet; } return NULL; }
void PubSubKeepAllTransientWriter::send(const std::list<uint16_t> &msgs) { waitDiscovery(); for(std::list<uint16_t>::const_iterator it = msgs.begin(); it != msgs.end(); ++it) { HelloWorld hello; hello.index(*it); hello.message("HelloWorld"); publisher_->write((void*)&hello); } }
CCScene* HelloWorld::scene() { CCScene *scene = CCScene::create(); HelloWorld *layer = HelloWorld::create(); scene->addChild(layer); CCNode* node = CCNode::create(); layer->addChild(node); StageScene::shareStageScene()->m_DialogContainer = node; return scene; }
bool HelloWorldType::serialize(void* data, SerializedPayload_t* payload) { HelloWorld* hw = (HelloWorld*) data; // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer((char*)payload->data, payload->max_size); // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer); //serialize the object: hw->serialize(ser); payload->length = (uint16_t)ser.getSerializedDataLength(); return true; }
int main(int argc, char **argv) { HelloWorld *hw = new HelloWorld("Hello World!\n");//HelloWorld constructor hw->setUpHelloWorld();//Set Up method call //This is not recommended, but now we need to non stop the running on the Whiteboard while(1) { sleep(300); }; }
CCScene* HelloWorld::scene() { // 'scene' is an autorelease object CCScene *scene = CCScene::create(); // 'layer' is an autorelease object HelloWorld *layer = HelloWorld::create(); layer->setTag(layerTag); // add layer as a child to scene scene->addChild(layer); // return the scene return scene; }
int main() { try { HelloWorld app; app.Run(); Environment::WaitForTermination(); } catch(exception& e) { LOG(LogError)<<e.what(); } }
// This function will be called when the app is inactive. When comes a phone call,it's be invoked too void AppDelegate::applicationDidEnterBackground() { CCDirector::sharedDirector()->stopAnimation(); //Retrieve HelloWorld scene by using the tag and call the pauseGame method CCScene* scene = (CCDirector::sharedDirector()->getRunningScene()); if (scene !=NULL) { HelloWorld* helloWorldScene = dynamic_cast <HelloWorld*>(scene->getChildByTag(100)); if (helloWorldScene != NULL) { helloWorldScene->pauseGame(); } } }
void PubSubHelloWorldReader::Listener::onNewDataMessage(Subscriber *sub) { ASSERT_NE(sub, nullptr); HelloWorld hello; SampleInfo_t info; if(sub->takeNextData((void*)&hello, &info)) { if(info.sampleKind == ALIVE) { reader_.newNumber(hello.index()); } } }
void ReqRepHelloWorldRequester::send(const uint16_t number) { waitDiscovery(); WriteParams wparams; HelloWorld hello; hello.index(number); hello.message("HelloWorld"); std::unique_lock<std::mutex> lock(mutex_); ASSERT_EQ(request_publisher_->write((void*)&hello, wparams), true); related_sample_identity_ = wparams.sample_identity(); current_number_ = number; }
HelloWorld* HelloWorld::create() \ { \ HelloWorld *pRet = new HelloWorld(); \ if (pRet && pRet->init()) \ { \ pRet->autorelease(); \ return pRet; \ } \ else \ { \ delete pRet; \ pRet = NULL; \ return NULL; \ } \ }
void ReqRepHelloWorldRequester::ReplyListener::onNewDataMessage(Subscriber *sub) { ASSERT_NE(sub, nullptr); HelloWorld hello; SampleInfo_t info; if(sub->takeNextData((void*)&hello, &info)) { if(info.sampleKind == ALIVE) { ASSERT_EQ(hello.message().compare("GoodBye"), 0); requester_.newNumber(info.related_sample_identity, hello.index()); } } }
int main(int /*argc*/, char ** /*argv[]*/) { cout << "HelloWorldSync" << endl; int iRv = 0; try { HelloWorld helloWorld; helloWorld.start(); helloWorld.stop(); } catch (std::exception& e) { cerr << "Exception: " << e.what() << "\n"; iRv = -1; } return iRv;; }
/** * wxAppの実装 */ bool MyApp::OnInit() { if (!wxApp::OnInit()) return false; wxHelloWorld = new HelloWorld(wxT("wxWidgetsでHelloWorld!!")); wxHelloWorld->Show(true); return true; }