Exemplo n.º 1
0
 static Handle<Value> New(const Arguments& args)
 {
   HandleScope scope;
   HelloWorld* hw = new HelloWorld();
   hw->Wrap(args.This());
   return args.This();
 }
Exemplo n.º 2
0
int main() {
	HelloWorld hw;
	hw.communicate();

	system("PAUSE");
	return 0;
}
Exemplo n.º 3
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;
} 
Exemplo n.º 6
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;
 };
Exemplo n.º 9
0
int _tmain(int argc, _TCHAR* argv[])
{
	HelloWorld hw;

	hw.SayThis(L"I'm a native client");

	return 0;
}
Exemplo n.º 10
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);
}
Exemplo n.º 11
0
int main()
{
	// Lets Greet the World!
	HelloWorld GreetMe;
	GreetMe.SayHello();

	system("pause");
	return 0;
}
Exemplo n.º 12
0
void FrontCoverLayer::showmsg(const char *msg)
{
    CCNode* parent = this->getParent();
    HelloWorld* helloworld = dynamic_cast<HelloWorld*>(parent);
    if(helloworld)
    {
        helloworld->showMessage(msg);
    }
}
Exemplo n.º 13
0
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);
}
Exemplo n.º 14
0
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;
}
Exemplo n.º 15
0
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;
}
Exemplo n.º 16
0
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);
}
Exemplo n.º 17
0
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);
	}
}
Exemplo n.º 19
0
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;
}
Exemplo n.º 20
0
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;
}
Exemplo n.º 21
0
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;
}
Exemplo n.º 23
0
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();
    	}
    }


}
Exemplo n.º 25
0
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());
		}
	}
}
Exemplo n.º 26
0
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;
}
Exemplo n.º 27
0
HelloWorld* HelloWorld::create() \
{ \
    HelloWorld *pRet = new HelloWorld(); \
    if (pRet && pRet->init()) \
    { \
        pRet->autorelease(); \
        return pRet; \
    } \
    else \
    { \
        delete pRet; \
        pRet = NULL; \
        return NULL; \
    } \
}
Exemplo n.º 28
0
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());
        }
    }
}
Exemplo n.º 29
0
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;;
}
Exemplo n.º 30
0
/**
 * wxAppの実装
 */
bool MyApp::OnInit() {

    if (!wxApp::OnInit())
	 return false;

     wxHelloWorld = new HelloWorld(wxT("wxWidgetsでHelloWorld!!"));
     wxHelloWorld->Show(true);

     return true;
}