Integer conversion for new stuff, formatting

nix
Owen Green 6 years ago
parent 683bb66791
commit 7159392a9b

@ -33,24 +33,23 @@ class FluidSCWrapper;
namespace impl { namespace impl {
template <size_t N, typename T> template <size_t N, typename T>
struct AssignBuffer struct AssignBuffer
{
void operator()(const typename BufferT::type& p, World* w)
{ {
void operator()(const typename BufferT::type &p, World *w) if (auto b = static_cast<SCBufferAdaptor*>(p.get())) b->assignToRT(w);
{ }
if (auto b = static_cast<SCBufferAdaptor *>(p.get())) };
b->assignToRT(w);
}
};
template <size_t N, typename T> template <size_t N, typename T>
struct CleanUpBuffer struct CleanUpBuffer
{
void operator()(const typename BufferT::type& p)
{ {
void operator()(const typename BufferT::type &p) if (auto b = static_cast<SCBufferAdaptor*>(p.get())) b->cleanUp();
{ }
if (auto b = static_cast<SCBufferAdaptor *>(p.get())) b->cleanUp(); };
}
};
// Iterate over kr/ir inputs via callbacks from params object // Iterate over kr/ir inputs via callbacks from params object
@ -67,10 +66,8 @@ struct FloatControlsIter
} }
index size() const noexcept { return mSize; } index size() const noexcept { return mSize; }
index remain() index remain() { return mSize - mCount; }
{
return mSize - mCount;
}
private: private:
float** mValues; float** mValues;
index mSize; index mSize;
@ -163,7 +160,8 @@ public:
void next(int) void next(int)
{ {
mControlsIterator.reset(mInBuf + mSpecialIndex + 1); // mClient.audioChannelsIn()); mControlsIterator.reset(mInBuf + mSpecialIndex +
1); // mClient.audioChannelsIn());
Wrapper::setParams( Wrapper::setParams(
mParams, mWorld->mVerbosity > 0, mWorld, mParams, mWorld->mVerbosity > 0, mWorld,
mControlsIterator); // forward on inputs N + audio inputs as params mControlsIterator); // forward on inputs N + audio inputs as params
@ -339,7 +337,8 @@ public:
// cancels using u_cmd, this is what will fire // cancels using u_cmd, this is what will fire
if (r.status() == Result::Status::kCancelled) if (r.status() == Result::Status::kCancelled)
{ {
std::cout << Wrapper::getName() << ": Processing cancelled" << std::endl; std::cout << Wrapper::getName() << ": Processing cancelled"
<< std::endl;
w->mCancelled = true; w->mCancelled = true;
return false; return false;
} }
@ -492,9 +491,9 @@ class FluidSCWrapperImpl<Client, Wrapper, std::false_type, std::true_type>
// Make base class(es), full of CRTP mixin goodness // Make base class(es), full of CRTP mixin goodness
template <typename Client> template <typename Client>
using FluidSCWrapperBase = using FluidSCWrapperBase = FluidSCWrapperImpl<Client, FluidSCWrapper<Client>,
FluidSCWrapperImpl<Client, FluidSCWrapper<Client>, typename Client::isNonRealTime, typename Client::isNonRealTime,
typename Client::isRealTime>; typename Client::isRealTime>;
} // namespace impl } // namespace impl
@ -511,56 +510,74 @@ class FluidSCWrapper : public impl::FluidSCWrapperBase<C>
struct ParamReader struct ParamReader
{ {
static auto fromArgs(World *, sc_msg_iter* args, std::string, int) static auto fromArgs(World*, sc_msg_iter* args, std::string, int)
{ {
const char* recv = args->gets(""); const char* recv = args->gets("");
return std::string(recv?recv:""); return std::string(recv ? recv : "");
} }
static auto fromArgs(World *w, FloatControlsIter& args, std::string, int) static auto fromArgs(World* w, FloatControlsIter& args, std::string, int)
{ {
//first is string size, then chars // first is string size, then chars
index size = static_cast<index>(args.next()); index size = static_cast<index>(args.next());
char* chunk = static_cast<char*>(FluidSCWrapper::getInterfaceTable()->fRTAlloc(w,size + 1)); char* chunk =
static_cast<char*>(FluidSCWrapper::getInterfaceTable()->fRTAlloc(
w, asUnsigned(size + 1)));
if (!chunk) { if (!chunk)
std::cout << "ERROR: " << FluidSCWrapper::getName() << ": RT memory allocation failed\n"; {
return std::string{""}; std::cout << "ERROR: " << FluidSCWrapper::getName()
} << ": RT memory allocation failed\n";
return std::string{""};
}
for(index i = 0; i < size; ++i) for (index i = 0; i < size; ++i)
chunk[i] = static_cast<char>(args.next()); chunk[i] = static_cast<char>(args.next());
chunk[size] = 0; //terminate string chunk[size] = 0; // terminate string
return std::string{chunk}; return std::string{chunk};
} }
template<typename T> template <typename T>
static std::enable_if_t<std::is_integral<T>::value,T> static std::enable_if_t<std::is_integral<T>::value, T>
fromArgs(World *, FloatControlsIter& args, T, int) { return static_cast<index>(args.next()); } fromArgs(World*, FloatControlsIter& args, T, int)
{
return static_cast<index>(args.next());
}
template<typename T> template <typename T>
static std::enable_if_t<std::is_floating_point<T>::value,T> static std::enable_if_t<std::is_floating_point<T>::value, T>
fromArgs(World *, FloatControlsIter& args, T, int) { return args.next(); } fromArgs(World*, FloatControlsIter& args, T, int)
{
return args.next();
}
template<typename T> template <typename T>
static std::enable_if_t<std::is_integral<T>::value,T> static std::enable_if_t<std::is_integral<T>::value, T>
fromArgs(World *, sc_msg_iter* args, T, int defVal) { return args->geti(defVal); } fromArgs(World*, sc_msg_iter* args, T, int defVal)
{
return args->geti(defVal);
}
template<typename T> template <typename T>
static std::enable_if_t<std::is_floating_point<T>::value,T> static std::enable_if_t<std::is_floating_point<T>::value, T>
fromArgs(World *, sc_msg_iter* args, T, int) { return args->getf(); } fromArgs(World*, sc_msg_iter* args, T, int)
{
return args->getf();
}
static auto fromArgs(World *w, ArgType args, BufferT::type&, int) static auto fromArgs(World* w, ArgType args, BufferT::type&, int)
{ {
typename LongT::type bufnum = static_cast<typename LongT::type>(ParamReader::fromArgs(w, args, typename LongT::type(), -1)); typename LongT::type bufnum = static_cast<typename LongT::type>(
return BufferT::type(bufnum >= 0 ? new SCBufferAdaptor(bufnum, w) : nullptr); ParamReader::fromArgs(w, args, typename LongT::type(), -1));
return BufferT::type(bufnum >= 0 ? new SCBufferAdaptor(bufnum, w)
: nullptr);
} }
static auto fromArgs(World *w, ArgType args, InputBufferT::type&, int) static auto fromArgs(World* w, ArgType args, InputBufferT::type&, int)
{ {
typename LongT::type bufnum = typename LongT::type bufnum =
static_cast<LongT::type>(fromArgs(w, args, LongT::type(), -1)); static_cast<LongT::type>(fromArgs(w, args, LongT::type(), -1));
@ -568,29 +585,29 @@ class FluidSCWrapper : public impl::FluidSCWrapperBase<C>
: nullptr); : nullptr);
} }
template<typename P> template <typename P>
static std::enable_if_t<IsSharedClient<P>::value,P> static std::enable_if_t<IsSharedClient<P>::value, P>
fromArgs(World *w, ArgType args, P&, int) fromArgs(World* w, ArgType args, P&, int)
{ {
return {fromArgs(w, args, std::string{}, 0).c_str()}; return {fromArgs(w, args, std::string{}, 0).c_str()};
} }
}; };
// Iterate over arguments via callbacks from params object // Iterate over arguments via callbacks from params object
template <typename ArgType, size_t N, typename T> template <typename ArgType, size_t N, typename T>
struct Setter struct Setter
{ {
static constexpr index argSize = C::getParameterDescriptors().template get<N>().fixedSize; static constexpr index argSize =
C::getParameterDescriptors().template get<N>().fixedSize;
typename T::type operator()(World *w, ArgType args) typename T::type operator()(World* w, ArgType args)
{ {
//Just return default if there's nothing left to grab // Just return default if there's nothing left to grab
if(args.remain() == 0) if (args.remain() == 0)
{ {
std::cout << "WARNING: " << getName() << " received fewer parameters than expected\n"; std::cout << "WARNING: " << getName()
<< " received fewer parameters than expected\n";
return C::getParameterDescriptors().template makeValue<N>(); return C::getParameterDescriptors().template makeValue<N>();
} }
@ -599,7 +616,8 @@ class FluidSCWrapper : public impl::FluidSCWrapperBase<C>
typename ParamLiteralConvertor<T, argSize>::LiteralType; typename ParamLiteralConvertor<T, argSize>::LiteralType;
for (index i = 0; i < argSize; i++) for (index i = 0; i < argSize; i++)
a[i] = static_cast<LiteralType>(ParamReader<ArgType>::fromArgs(w, args, a[0], 0)); a[i] = static_cast<LiteralType>(
ParamReader<ArgType>::fromArgs(w, args, a[0], 0));
return a.value(); return a.value();
} }
@ -611,198 +629,252 @@ class FluidSCWrapper : public impl::FluidSCWrapperBase<C>
template <size_t N, typename T> template <size_t N, typename T>
using ControlSetter = Setter<FloatControlsIter&, N, T>; using ControlSetter = Setter<FloatControlsIter&, N, T>;
//CryingEmoji.png: SC API hides all the useful functions for sending // CryingEmoji.png: SC API hides all the useful functions for sending
//replies back to the language with things like, uh, strings and stuff. // replies back to the language with things like, uh, strings and stuff.
//We have Node_SendReply, which assumes you are sending an array of float, // We have Node_SendReply, which assumes you are sending an array of float,
//and must be called only from the RT thread. Thanks. // and must be called only from the RT thread. Thanks.
//So, we do in reverse what the SendReply Ugen does, and parse // So, we do in reverse what the SendReply Ugen does, and parse
//an array of floats as characters in the language. VomitEmoji.png // an array of floats as characters in the language. VomitEmoji.png
struct ToFloatArray struct ToFloatArray
{ {
static size_t allocSize(typename BufferT::type){ return 1; } static index allocSize(typename BufferT::type) { return 1; }
template<typename T> template <typename T>
static std::enable_if_t<std::is_integral<T>::value||std::is_floating_point<T>::value,size_t> static std::enable_if_t<
allocSize(T){ return 1; } std::is_integral<T>::value || std::is_floating_point<T>::value, index>
allocSize(T)
{
return 1;
}
static index allocSize(std::string s){ return asSigned(s.size()) + 1; } //put null char at end when we send static index allocSize(std::string s)
{
return asSigned(s.size()) + 1;
} // put null char at end when we send
static index allocSize(FluidTensor<std::string,1> s) static index allocSize(FluidTensor<std::string, 1> s)
{ {
index count = 0; index count = 0;
for(auto& str: s) count += (str.size() + 1); for (auto& str : s) count += (str.size() + 1);
return count; return count;
} }
template<typename T>
static index allocSize(FluidTensor<T,1> s) { return asSigned(s.size()); }
template<typename...Ts> template <typename T>
static std::tuple<std::array<size_t,sizeof...(Ts)>,index> allocSize(std::tuple<Ts...>&& t) static index allocSize(FluidTensor<T, 1> s)
{ {
return allocSizeImpl(std::forward<decltype(t)>(t), std::index_sequence_for<Ts...>()); return s.size();
}; }
template<typename...Ts, size_t...Is> template <typename... Ts>
static std::tuple<std::array<size_t,sizeof...(Ts)>,index> allocSizeImpl(std::tuple<Ts...>&& t,std::index_sequence<Is...>) static std::tuple<std::array<index, sizeof...(Ts)>, index>
allocSize(std::tuple<Ts...>&& t)
{ {
index size{0}; return allocSizeImpl(std::forward<decltype(t)>(t),
std::array<size_t,sizeof...(Ts)> res; std::index_sequence_for<Ts...>());
(void)std::initializer_list<int>{(res[Is] = size,size += ToFloatArray::allocSize(std::get<Is>(t)),0)...};
return std::make_tuple(res,size); //array of offsets into allocated buffer & total number of floats to alloc
}; };
static void convert(float* f, typename BufferT::type buf) { f[0] = static_cast<SCBufferAdaptor*>(buf.get())->bufnum(); } template <typename... Ts, size_t... Is>
static std::tuple<std::array<index, sizeof...(Ts)>, index>
allocSizeImpl(std::tuple<Ts...>&& t, std::index_sequence<Is...>)
{
index size{0};
std::array<index, sizeof...(Ts)> res;
(void) std::initializer_list<int>{
(res[Is] = size, size += ToFloatArray::allocSize(std::get<Is>(t)),
0)...};
return std::make_tuple(res,
size); // array of offsets into allocated buffer &
// total number of floats to alloc
};
template<typename T> static void convert(float* f, typename BufferT::type buf)
static std::enable_if_t<std::is_integral<T>::value||std::is_floating_point<T>::value> {
convert(float* f, T x) { f[0] = static_cast<float>(x); } f[0] = static_cast<SCBufferAdaptor*>(buf.get())->bufnum();
}
template <typename T>
static std::enable_if_t<std::is_integral<T>::value ||
std::is_floating_point<T>::value>
convert(float* f, T x)
{
f[0] = static_cast<float>(x);
}
static void convert(float* f, std::string s) static void convert(float* f, std::string s)
{ {
std::copy(s.begin(), s.end(), f); std::copy(s.begin(), s.end(), f);
f[s.size()] = 0; //terminate f[s.size()] = 0; // terminate
} }
static void convert(float* f, FluidTensor<std::string,1> s) static void convert(float* f, FluidTensor<std::string, 1> s)
{ {
for(auto& str: s) for (auto& str : s)
{ {
std::copy(str.begin(), str.end(), f); std::copy(str.begin(), str.end(), f);
f += str.size(); f += str.size();
*f++ = 0; *f++ = 0;
} }
} }
template<typename T> template <typename T>
static void convert(float* f, FluidTensor<T,1> s) static void convert(float* f, FluidTensor<T, 1> s)
{ {
static_assert(std::is_convertible<T,float>::value,"Can't convert this to float output"); static_assert(std::is_convertible<T, float>::value,
std::copy(s.begin(), s.end(), f); "Can't convert this to float output");
std::copy(s.begin(), s.end(), f);
} }
template<typename...Ts, size_t...Is> template <typename... Ts, size_t... Is>
static void convert(float* f,std::tuple<Ts...>&& t, std::array<size_t,sizeof...(Ts)> offsets, std::index_sequence<Is...>) static void convert(float* f, std::tuple<Ts...>&& t,
std::array<index, sizeof...(Ts)> offsets,
std::index_sequence<Is...>)
{ {
(void)std::initializer_list<int>{(convert(f + offsets[Is],std::get<Is>(t)),0)...}; (void) std::initializer_list<int>{
(convert(f + offsets[Is], std::get<Is>(t)), 0)...};
} }
}; };
//So, to handle a message to a plugin we will need to // So, to handle a message to a plugin we will need to
// (1) Launch the invovation of the message on the SC NRT Queue using FIFO Message // (1) Launch the invovation of the message on the SC NRT Queue using FIFO
// (2) Run the actual function (maybe asynchronously, in our own thread) // Message (2) Run the actual function (maybe asynchronously, in our own
// (3) Launch an asynchronous command to send the reply back (in Stage 3) // thread) (3) Launch an asynchronous command to send the reply back (in Stage
// 3)
template<size_t N, typename Ret, typename ArgTuple> template <size_t N, typename Ret, typename ArgTuple>
struct MessageDispatch struct MessageDispatch
{ {
static constexpr size_t Message = N; static constexpr size_t Message = N;
FluidSCWrapper* wrapper; FluidSCWrapper* wrapper;
ArgTuple args; ArgTuple args;
Ret result; Ret result;
std::string name; std::string name;
}; };
//Sets up a single /u_cmd // Sets up a single /u_cmd
template<size_t N, typename T> template <size_t N, typename T>
struct SetupMessage struct SetupMessage
{ {
void operator()(const T& message) void operator()(const T& message)
{ {
auto ft = getInterfaceTable(); auto ft = getInterfaceTable();
ft->fDefineUnitCmd(getName(), message.name, launchMessage<N>); ft->fDefineUnitCmd(getName(), message.name, launchMessage<N>);
} }
}; };
template<size_t N> template <size_t N>
static void launchMessage(Unit* u,sc_msg_iter* args) static void launchMessage(Unit* u, sc_msg_iter* args)
{ {
FluidSCWrapper* x = static_cast<FluidSCWrapper*>(u); FluidSCWrapper* x = static_cast<FluidSCWrapper*>(u);
using IndexList = typename Client::MessageSetType::template MessageDescriptorAt<N>::IndexList; using IndexList =
launchMessageImpl<N>(x,args,IndexList()); typename Client::MessageSetType::template MessageDescriptorAt<
N>::IndexList;
launchMessageImpl<N>(x, args, IndexList());
} }
template<size_t N, size_t...Is> template <size_t N, size_t... Is>
static void launchMessageImpl(FluidSCWrapper* x,sc_msg_iter* inArgs,std::index_sequence<Is...>) static void launchMessageImpl(FluidSCWrapper* x, sc_msg_iter* inArgs,
std::index_sequence<Is...>)
{ {
using MessageDescriptor = typename Client::MessageSetType::template MessageDescriptorAt<N>; using MessageDescriptor =
typename Client::MessageSetType::template MessageDescriptorAt<N>;
using ArgTuple = typename MessageDescriptor::ArgumentTypes; using ArgTuple = typename MessageDescriptor::ArgumentTypes;
using ReturnType = typename MessageDescriptor::ReturnType; using ReturnType = typename MessageDescriptor::ReturnType;
using IndexList = typename MessageDescriptor::IndexList; using IndexList = typename MessageDescriptor::IndexList;
using MessageData = MessageDispatch<N,ReturnType,ArgTuple>; using MessageData = MessageDispatch<N, ReturnType, ArgTuple>;
auto ft = getInterfaceTable(); auto ft = getInterfaceTable();
void* msgptr = ft->fRTAlloc(x->mWorld,sizeof(MessageData)); void* msgptr = ft->fRTAlloc(x->mWorld, sizeof(MessageData));
MessageData* msg = new(msgptr) MessageData; MessageData* msg = new (msgptr) MessageData;
ArgTuple& args = msg->args; ArgTuple& args = msg->args;
(void)std::initializer_list<int>{(std::get<Is>(args) = ParamReader<sc_msg_iter*>::fromArgs(x->mWorld,inArgs,std::get<Is>(args),0),0)...}; (void) std::initializer_list<int>{
(std::get<Is>(args) = ParamReader<sc_msg_iter*>::fromArgs(
x->mWorld, inArgs, std::get<Is>(args), 0),
0)...};
msg->name = '/' + Client::getMessageDescriptors().template name<N>(); msg->name = '/' + Client::getMessageDescriptors().template name<N>();
msg->wrapper = x; msg->wrapper = x;
x->mDone = false; x->mDone = false;
ft->fDoAsynchronousCommand(x->mWorld, nullptr, getName(), msg, ft->fDoAsynchronousCommand(
[](World*, void* data) //NRT thread: invocation x->mWorld, nullptr, getName(), msg,
{ [](World*, void* data) // NRT thread: invocation
MessageData* m = static_cast<MessageData*>(data); {
m->result = ReturnType{invokeImpl<N>(m->wrapper, m->args, IndexList{})}; MessageData* m = static_cast<MessageData*>(data);
m->result =
if(!m->result.ok()) ReturnType{invokeImpl<N>(m->wrapper, m->args, IndexList{})};
{
printResult(m->wrapper, m->result); if (!m->result.ok())
return false; {
} printResult(m->wrapper, m->result);
return true; return false;
}, }
[](World* world, void* data) //RT thread: response return true;
{ },
MessageData* m = static_cast<MessageData*>(data); [](World* world, void* data) // RT thread: response
MessageDescriptor::template forEachArg<typename BufferT::type,impl::AssignBuffer>(m->args, world); {
messageOutput(m->wrapper,m->name,m->result); MessageData* m = static_cast<MessageData*>(data);
return true; MessageDescriptor::template forEachArg<typename BufferT::type,
} impl::AssignBuffer>(m->args,
, nullptr, //NRT Thread: No-op world);
[](World* w, void* data) //RT thread: clean up messageOutput(m->wrapper, m->name, m->result);
{ return true;
getInterfaceTable()->fRTFree(w,data); },
}, nullptr, // NRT Thread: No-op
0, nullptr); [](World* w, void* data) // RT thread: clean up
} { getInterfaceTable()->fRTFree(w, data); },
0, nullptr);
template <size_t N, typename ArgsTuple,size_t...Is> //Call from NRT }
static decltype(auto) invokeImpl(FluidSCWrapper* x, ArgsTuple& args, std::index_sequence<Is...>)
{ template <size_t N, typename ArgsTuple, size_t... Is> // Call from NRT
return x->mClient.template invoke<N>(x->mClient,std::get<Is>(args)...); static decltype(auto) invokeImpl(FluidSCWrapper* x, ArgsTuple& args,
} std::index_sequence<Is...>)
template<typename T> //call from RT
static void messageOutput(FluidSCWrapper* x, const std::string& s, MessageResult<T>& result)
{
auto ft = getInterfaceTable();
//allocate return values
size_t numArgs = ToFloatArray::allocSize(static_cast<T>(result));
float* values = static_cast<float*>(ft->fRTAlloc(x->mWorld,numArgs * sizeof(float)));
//copy return data
ToFloatArray::convert(values,static_cast<T>(result));
ft->fSendNodeReply(&x->mParent->mNode, -1, s.c_str(), static_cast<int>(numArgs), values);
}
static void messageOutput(FluidSCWrapper* x, const std::string& s, MessageResult<void>&)
{ {
auto ft = getInterfaceTable(); return x->mClient.template invoke<N>(x->mClient, std::get<Is>(args)...);
ft->fSendNodeReply(&x->mParent->mNode, -1, s.c_str(), 0, nullptr); }
template <typename T> // call from RT
static void messageOutput(FluidSCWrapper* x, const std::string& s,
MessageResult<T>& result)
{
auto ft = getInterfaceTable();
// allocate return values
index numArgs = ToFloatArray::allocSize(static_cast<T>(result));
float* values = static_cast<float*>(
ft->fRTAlloc(x->mWorld, asUnsigned(numArgs) * sizeof(float)));
// copy return data
ToFloatArray::convert(values, static_cast<T>(result));
ft->fSendNodeReply(&x->mParent->mNode, -1, s.c_str(),
static_cast<int>(numArgs), values);
} }
template<typename...Ts> static void messageOutput(FluidSCWrapper* x, const std::string& s,
static void messageOutput(FluidSCWrapper* x, const std::string& s, MessageResult<std::tuple<Ts...>>& result) MessageResult<void>&)
{ {
auto ft = getInterfaceTable(); auto ft = getInterfaceTable();
std::array<size_t,sizeof...(Ts)> offsets; ft->fSendNodeReply(&x->mParent->mNode, -1, s.c_str(), 0, nullptr);
size_t numArgs;
std::tie(offsets,numArgs) = ToFloatArray::allocSize(static_cast<std::tuple<Ts...>>(result));
float* values = static_cast<float*>(ft->fRTAlloc(x->mWorld,numArgs * sizeof(float)));
ToFloatArray::convert(values,std::tuple<Ts...>(result),offsets,std::index_sequence_for<Ts...>());
ft->fSendNodeReply(&x->mParent->mNode, -1, s.c_str(), static_cast<int>(numArgs), values);
} }
template <typename... Ts>
static void messageOutput(FluidSCWrapper* x, const std::string& s,
MessageResult<std::tuple<Ts...>>& result)
{
auto ft = getInterfaceTable();
std::array<index, sizeof...(Ts)> offsets;
index numArgs;
std::tie(offsets, numArgs) =
ToFloatArray::allocSize(static_cast<std::tuple<Ts...>>(result));
float* values = static_cast<float*>(
ft->fRTAlloc(x->mWorld, asUnsigned(numArgs) * sizeof(float)));
ToFloatArray::convert(values, std::tuple<Ts...>(result), offsets,
std::index_sequence_for<Ts...>());
ft->fSendNodeReply(&x->mParent->mNode, -1, s.c_str(),
static_cast<int>(numArgs), values);
}
static void doVersion(Unit*, sc_msg_iter*) static void doVersion(Unit*, sc_msg_iter*)
@ -865,30 +937,27 @@ public:
switch (r.status()) switch (r.status())
{ {
case Result::Status::kWarning: case Result::Status::kWarning: {
{ if (x->mWorld->mVerbosity > 0)
if(x->mWorld->mVerbosity > 0) std::cout << "WARNING: " << r.message().c_str() << '\n';
std::cout << "WARNING: " << r.message().c_str() << '\n'; break;
break; }
} case Result::Status::kError: {
case Result::Status::kError: std::cout << "ERROR: " << r.message().c_str() << '\n';
{ break;
std::cout << "ERROR: " << r.message().c_str() << '\n'; }
break; case Result::Status::kCancelled: {
} std::cout << "Task cancelled\n" << '\n';
case Result::Status::kCancelled: break;
{ }
std::cout << "Task cancelled\n" << '\n'; default: {
break; }
}
default: {
}
} }
} }
}; };
template <typename Client> template <typename Client>
void makeSCWrapper(const char *name, InterfaceTable *ft) void makeSCWrapper(const char* name, InterfaceTable* ft)
{ {
FluidSCWrapper<Client>::setup(ft, name); FluidSCWrapper<Client>::setup(ft, name);
} }

Loading…
Cancel
Save