void UOscFunctionLibrary::PushInt(const TArray<FOscDataElemStruct> & input, int32 Value, TArray<FOscDataElemStruct> & output) { output = input; FOscDataElemStruct elem; elem.SetInt(Value); output.Add(elem); }
static void SendMessage(TCircularQueue<std::pair<FName, TArray<FOscDataElemStruct>>> & _pendingMessages, const osc::ReceivedMessage & message) { const FName address(message.AddressPattern()); TArray<FOscDataElemStruct> data; const auto argBegin = message.ArgumentsBegin(); const auto argEnd = message.ArgumentsEnd(); for(auto it = argBegin; it != argEnd; ++it) { FOscDataElemStruct elem; if(it->IsFloat()) { elem.SetFloat(it->AsFloatUnchecked()); } else if(it->IsDouble()) { elem.SetFloat(it->AsDoubleUnchecked()); } else if(it->IsInt32()) { elem.SetInt(it->AsInt32Unchecked()); } else if(it->IsInt64()) { elem.SetInt(it->AsInt64Unchecked()); } else if(it->IsBool()) { elem.SetBool(it->AsBoolUnchecked()); } else if(it->IsString()) { elem.SetString(FName(it->AsStringUnchecked())); } data.Add(elem); } // save it in pending messages _pendingMessages.Enqueue(std::make_pair(address, data)); }
FOscDataElemStruct UOscFunctionLibrary::FromInt(int32 input) { FOscDataElemStruct result; result.SetInt(input); return result; }