const std::string & AbstractPrimitiveInputAdaptor::valueByKey(const std::string & key) const { for (int i = 0; i < tagsSize(); ++i) { if (m_Controller->queryStringTable(keyId(i)) == key) return m_Controller->queryStringTable(valueId(i)); } return m_Controller->queryStringTable(NULL_STRING_ID); // return "null" string }
// ------------------------------------------------------------------- // Execute // ------------------------------------------------------------------- void SpectatorToPlayerRequest::Execute(boost::shared_ptr<SmartFox> sfs) { if (room == NULL) { room = sfs->LastJoinedRoom(); } boost::shared_ptr<long int> valueId (new long int()); *valueId = room->Id(); sfso->PutInt(KEY_ROOM_ID, valueId); }
// ------------------------------------------------------------------- // Execute // ------------------------------------------------------------------- void InvitationReplyRequest::Execute(boost::shared_ptr<SmartFox> sfs) { boost::shared_ptr<long int> valueId (new long int()); *valueId = invitation->Id(); sfso->PutInt(KEY_INVITATION_ID, valueId); boost::shared_ptr<unsigned char> valueReply (new unsigned char()); *valueReply = (unsigned char)(*reply); sfso->PutByte(KEY_INVITATION_REPLY, valueReply); if (parameters != NULL) sfso->PutSFSObject(KEY_INVITATION_PARAMS, parameters); }
Attributes * ShowplanAttributes::newCopy(CollHeap * heap) { ShowplanAttributes * new_copy = new(heap) ShowplanAttributes(valueId(), text()); *new_copy = *this; return new_copy; }
Attributes * ShowplanAttributes::newCopy() { ShowplanAttributes * new_copy = new ShowplanAttributes(valueId(), text()); *new_copy = *this; return new_copy; }
void Variable::setFromCP() { if(var_->contains(0)) valueId(0); else valueId(var_->value()); }
const std::string & AbstractPrimitiveInputAdaptor::value(int index) const { return m_Controller->queryStringTable(valueId(index)); }