int QXmppMucManager::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QXmppClientExtension::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 4)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 4;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< QList<QXmppMucRoom*>*>(_v) = rooms(); break;
        }
        _id -= 1;
    } else if (_c == QMetaObject::WriteProperty) {
        _id -= 1;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 1;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 1;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 1;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 1;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 1;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 1;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
예제 #2
0
void rooms(View* view, int lastInd = 0) {
  vector<View::ListElem> options;
  vector<PlayerControl::RoomInfo> roomList = PlayerControl::getRoomInfo();
  for (auto& elem : roomList)
    options.push_back(elem.name);
  auto index = view->chooseFromList("Rooms", options, lastInd);
  if (!index)
    return;
  room(view, roomList[*index]);
  rooms(view, *index);
}
예제 #3
0
int main(int argc, char *argv[])
{
	string configFilename = "Config.json";
	string logFilename = "-";

#ifndef _WIN32
	cmdline::parser arg;
	arg.add<string>("config", 'c', "configuration file", false, "Config.json");
	arg.add<string>("log", 'l', "log file", false, "-");
	arg.parse_check(argc, argv);
	configFilename = arg.get<string>("config");
	logFilename = arg.get<string>("log");
#endif 

	log_normal("Using configuration file: %s", configFilename.c_str());
	log_normal("Log file: %s", logFilename.c_str());

	setLogFile(logFilename);

	Document configDoc = loadConfigObj(configFilename);
	Value &roomsVal = configDoc["Rooms"];
	assert(roomsVal.IsArray());
	vector<RoomInfo> rooms(loadRooms(roomsVal));

	initLibraries();

	CubeServer server;
	configRooms(server, rooms);

	server.EnableTimer(CHECK_INTERVAL_uS);

	configServer(server, configDoc["Server"]);

	server.IsRunning = true;
	thread th(eventEntry, &server);

	initHandlers();
	handleCommand(server);

	server.Stop();
	th.join();

	log_normal("%s", "Stopped.");

#ifdef MEM_DEBUG
#ifdef _WIN32
	_CrtDumpMemoryLeaks();
#endif 
#endif 

	return 0;
}
예제 #4
0
int main() {
	int n;
	char cn[20];
	list l;
	customer c;
	date d1, d2;
	printf("Welcome to hotel GRAND :\n");
	printf("Total rooms in hotel are: 500\n");
	printf("Single rooms are: 300\nDouble rooms are: 200");
	printf("Cost for one day:\nSingle room stay is:'350'\nDouble room stay is:'600'\n");
	while(1) {
		n = options();
		switch(n) {
			case 1:
				cs_info(&c);
				printf("Entry Date:\n");
				date_info(&d1);
				printf("Exit Date:\n");
				date_info(&d2);
				checkin(&l, &c, &d1, &d2);
				traverse(&l);
				break;
			case 2:
				printf("Enter the name of Customer who want to Checkout\n");
				scanf("%s", cn);
				checkout(&l, &c, &d1, &d2, cn);
				traverse(&l);
				break;
			case 3:
				total_bill(&c, &d1, &d2);
				printf("Your total bill is:%d\n",c.total_bill);
				break;
			case 4:
				rooms();
				break;
			default:
				printf("SORRY we don't get you\nPlease enter the valid option\n");
		}
	}
	return 0;
}
예제 #5
0
int main(void)
{
	DDRA = 0xFF; PORTA = 0x00;
	DDRB = 0xF0; PORTB = 0x0F;
   DDRD = 0xFF; PORTB = 0x00;
 DDRC = 0xF0; PORTC = 0x0F;

	room_state = init;
   LI_State = LI_Init1;
   outputRoom_state = initLCD;
   shotsFired_state = initShots;
	TimerSet(100);
	TimerOn();
    while(1)
    {
		rooms();
      LI_Tick ();
      outputRoom ();
	  shotsFired();
        while(!TimerFlag);
        TimerFlag = 0;
    }
}
예제 #6
0
BuildingModel::BuildingModel(Building* building)
{
    foreach(auto floor, building->floors()) {
        _rooms.append(floor->rooms());
    }
}