Exemplo n.º 1
0
void SCLang::SendReplyCatcher(int synth_id, int reply_id, float value){
  auto it = sendreply_map.find({reply_id, synth_id});
  if(it == sendreply_map.end()){
    std::cout << "WARNING: recieved an unregistered sendreply " << synth_id << " " << reply_id << std::endl;
    return;
  }
  auto ctrl = it->second.lock();
  if(!ctrl){
    std::cout << "WARNING: recieved a registered sendreply, but the controller does not exist anymore" << std::endl;
    return;
  }
  ctrl->Got(value);
}
Exemplo n.º 2
0
void NetworkTable::Put(const char *keyName, std::auto_ptr<NetworkTables::Entry> value)
{
	if (keyName == NULL)
	{
		wpi_setWPIErrorWithContext(NullParameter, "keyName");
		return;
	}
	Synchronized sync(m_dataLock);
	NetworkTables::Key *key = GetKey(keyName);
	value->SetKey(key);

	if (m_transactionCount == 0)
		Got(true, key, value);
	else
		m_transaction->Offer(std::auto_ptr<NetworkTables::Data>(value.release()));
}