当前位置: 首页>>代码示例>>C++>>正文


C++ Hello类代码示例

本文整理汇总了C++中Hello的典型用法代码示例。如果您正苦于以下问题:C++ Hello类的具体用法?C++ Hello怎么用?C++ Hello使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Hello类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: client

static void client()
{
	log4cxx::NDC ndc("client");
	ORWELL_LOG_INFO("client ...");
	zmq::context_t aContext(1);
	usleep(1 * 1000);
	ORWELL_LOG_INFO("create pusher");
	Sender aPusher("tcp://127.0.0.1:9000", ZMQ_PUSH, orwell::com::ConnectionMode::CONNECT, aContext);
	ORWELL_LOG_INFO("create subscriber");
	Receiver aSubscriber("tcp://127.0.0.1:9001", ZMQ_SUB, orwell::com::ConnectionMode::CONNECT, aContext);
	usleep(1 * 1000);

	ExpectGameState(false, aSubscriber);

	Hello aHelloMessage;
	aHelloMessage.set_name("playername");
	RawMessage aMessage("randomid", "Hello", aHelloMessage.SerializeAsString());
	aPusher.send(aMessage);

	ExpectGameState(true, aSubscriber);

	aPusher.send(aMessage);

	ORWELL_LOG_INFO("quit client");
}
开发者ID:fdiller,项目名称:server-game,代码行数:25,代码来源:start_game_condition.cpp

示例2: Hello

QWidget * HelloWorldPlugin::createWidgetPlugin(QWidget *parent, const char *name)
{
  Hello *hello = new Hello(pluginWindow()->caption(), parent, name);
  hello->setFont(QFont("times",14,QFont::Bold) );
  hello->setBackgroundColor(Qt::black);
  return hello;
}
开发者ID:soundgnome,项目名称:mysqlcc,代码行数:7,代码来源:hello_plugin.cpp

示例3: main

int main(int argc, char *argv[])
{

    Test *test = new Test;

    SOM_Test(!strcmp(test->somGetClassName(),"Test"));

    SOM_Test(test->somRespondsTo(somIdFromString("hello_")) == 1);
    SOM_Test(!strcmp(test->hello_(),"Hello World"));
    SOM_Test(test->somRespondsTo(somIdFromString("mello_")) == 1);
    SOM_Test(!strcmp(test->mello_(),"Mello World"));

    SOM_Test(test->somGetClass()->somRespondsTo(somIdFromString("HelloCreate")) == 1);
    Hello *a = ((M_Hello*) (test->somGetClass()))->HelloCreate("Hello from A");
    SOM_Test(!strcmp(a->hello_(),"Hello from A"));

    SOM_Test(test->somGetClass()->somRespondsTo(somIdFromString("MelloCreate")) == 1);
    Mello *b = ((M_Mello*) (test->somGetClass()))->MelloCreate("Mello from B");
    SOM_Test(!strcmp(b->mello_(),"Mello from B"));

    Hello *c = (Hello*) (test->somGetClass()->somNew());
    Mello *d = (Mello*) (test->somGetClass()->somNew());

    SOM_Test(!strcmp(c->hello_(),"Hello World"));
    SOM_Test(!strcmp(d->mello_(),"Mello World"));

    printf("Derived Metaclass Test Successfully Completed.\n");
    return 0;
}
开发者ID:OS2World,项目名称:DEV-WPS-SOM_Toolkit_Samples,代码行数:29,代码来源:main.cpp

示例4: TEST

TEST( HelloWorld_test, Say ) {
	MockMsg msg;
	EXPECT_CALL( msg, get_msg() )
		.WillOnce(Return("Hola!"));

	Hello saludador;
	saludador.say(&msg);
}
开发者ID:meteor-xy,项目名称:gcov_gtest_sample,代码行数:8,代码来源:hello_test.cpp

示例5: main

int main()
{
  Hello *h = new Hello();
  h->setFormal(true);
  h->greeting();
  delete h;
  return 0;
}
开发者ID:JohnUiterwyk,项目名称:robocakes,代码行数:8,代码来源:main.cpp

示例6: main

int
main ()
{
	Hello h;

	h.PrintHello ();

	return 0;
}
开发者ID:MavenRain,项目名称:cxxi,代码行数:9,代码来源:Hello.cpp

示例7: OnClickedRegistCancel

void Regist::OnClickedRegistCancel()
{
    Hello dlg;
    fatherflag = 1;
    ShowWindow(SW_HIDE);
    dlg.DoModal();
    ShowWindow(SW_SHOW);
    // TODO:  在此添加控件通知处理程序代码
}
开发者ID:ShipuW,项目名称:ebank-MFC,代码行数:9,代码来源:Regist.cpp

示例8: main

int main(){
std::cout << "Hello World!" << std::endl;
std::cout << "C++ Data Structures!" << std::endl;
Hello hello;
hello.printHello();

return 0;

}
开发者ID:MillerAJ,项目名称:CS240-Projects,代码行数:9,代码来源:lab1.cpp

示例9: OnClickedManagerLogout

void Manager::OnClickedManagerLogout()
{
	Hello dlg;
	CurrentUser = "";
	fatherflag = 1;
	ShowWindow(SW_HIDE);
	dlg.DoModal();
	ShowWindow(SW_SHOW);
	// TODO:  在此添加控件通知处理程序代码
}
开发者ID:ShipuW,项目名称:ebank-MFC,代码行数:10,代码来源:Manager.cpp

示例10: main

int main()
{
	setlocale(0, "");
	
	Hello h;
	
	h.World();
	h.Everybody();
	
	return 0;
}
开发者ID:andreikorniloff,项目名称:git-repo,代码行数:11,代码来源:Hello.cpp

示例11: Hello_stringFromJNI

static jstring Hello_stringFromJNI(JNIEnv* env,jobject thiz)
{
	Hello* he = (Hello*)env->GetIntField(thiz,helloFieldID);
	if(he == NULL)
		return NULL;
	char* jni_str = (char*)he->stringFromJNI();
	size_t size = strlen(jni_str);
	jchar* data = UTF8toUTF16((char*)jni_str,&size);
	jstring str = env->NewString(data,size);
	free(data);
	return str;
}
开发者ID:Andyload,项目名称:JniDemo,代码行数:12,代码来源:hello_jni.cpp

示例12: Hello_calculate

static jint Hello_calculate(JNIEnv* env,jobject thiz,jstring calculate,jint math,jint math2)
{
	Hello* he = (Hello*)env->GetIntField(thiz,helloFieldID);
	if(he == NULL)
		return -1;
	const jchar* cal = env->GetStringChars(calculate,NULL);
	jsize cal_size = env->GetStringLength(calculate);
	char* cal2 = UTF16toUTF8((jchar*)cal,(size_t*)&cal_size);
	int result = he->calculate(cal2,math,math2);
	env->ReleaseStringChars(calculate,cal);
	free(cal2);
	return (jint)result;
}
开发者ID:Andyload,项目名称:JniDemo,代码行数:13,代码来源:hello_jni.cpp

示例13: main

int main(int argc, const char * argv[])
{

    Hello *h = new Hello();
    h->sayHello("ZhangSan");
//    std::string name = "ZhangSan";
//    h->sayHello((char*)name.c_str());
    
    
    // insert code here...
    std::cout << "Hello, World!\n";
    return 0;
}
开发者ID:MarkSunDev,项目名称:CPPLessons,代码行数:13,代码来源:main.cpp

示例14: main

int main(int argc, const char * argv[])
{

    Hello *h = new Hello();
    
//    C写法
//    h->sayHello("Lance");
//    std::string name = "Lance";
//    转成C类型的字符串,这样就不会警告了。
//    h->sayHello((char *)name.c_str());
    
//    C++写法
    h->sayHello("Lance");
    
    
    
    
    return 0;
}
开发者ID:output,项目名称:CPPLesson,代码行数:19,代码来源:main.cpp

示例15: main

int main() {
    Talker t;
    t.SaySomething();
    Hello h;
    h.SaySomething();
    World w;
    w.SaySomething();

    //Now lets have some polymorphism !!!
    cout << "Polymorphic Hello World" << endl;

    vector<Talker *> talkers(2);
    talkers.at(0) = new Hello();
    talkers.at(1) = new World();

    for (int i = 0; i < talkers.size(); i++) {
        talkers.at(i)->SaySomething();
    }

}
开发者ID:drewdarko,项目名称:CS117-resources,代码行数:20,代码来源:Talker.cpp


注:本文中的Hello类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。