Пример #1
0
supla_client_locations::~supla_client_locations() {

	ids_clean();
	arr_clean();
	safe_array_free(arr);
	lck_free(this->lck);

}
Пример #2
0
void supla_client_channels::load(void) {

	database *db = new database();

	if ( db->connect() == true ) {

		safe_array_lock(arr);
		arr_clean();

		db->get_client_channels(client->getID(), NULL, this);

		safe_array_unlock(arr);
	}

	delete db;

}
Пример #3
0
void supla_device_channels::load(int DeviceID) {

	database *db = new database();

	if ( db->connect() == true ) {

		safe_array_lock(arr);
		arr_clean();

		db->get_device_channels(DeviceID, this);

		safe_array_unlock(arr);
	}

	delete db;

}
Пример #4
0
void supla_client_locations::load(int ClientID) {

	database *db = new database();
	int a, n;

	if ( db->connect() == true ) {

		safe_array_lock(arr);
		arr_clean();

		db->get_client_locations(ClientID, this);

		lck_lock(lck);
		ids_clean();

		n = safe_array_count(arr);

		if ( n > 0 ) {
			ids = (int*)malloc(sizeof(int)*n);
		}

		if ( ids )
			for(a=0;a<n;a++) {
				supla_client_location *loc = (supla_client_location *)safe_array_get(arr, a);
				if ( loc != NULL ) {
					ids[ids_count] = loc->getId();
					ids_count++;
				}
			}

		lck_unlock(lck);

		safe_array_unlock(arr);

	}

	delete db;

}
Пример #5
0
supla_client_channels::~supla_client_channels() {
	arr_clean();
	safe_array_free(arr);
}
Пример #6
0
supla_device_channels::~supla_device_channels() {
	arr_clean();
	safe_array_free(arr);
}