35 #define no_queue // MetaObject tag to give Invoke::NoQueue 42 #include <QGenericArgument> 49 #define MQ_ARG(type, label, data) MQArgument<type >(#type, #label, data) 52 class ArnRpcReceiverStorage;
53 class ArnDynamicSignals;
63 const void* aData = arnNullptr)
64 : QGenericArgument( aName, aData), _label(aLabel) {}
66 : QGenericArgument( qgenArg), _label(
"") {}
67 inline const char*
label()
const {
return _label;}
79 inline MQArgument(
const char* aName,
const char* aLabel,
const T &aData)
172 explicit ArnRpc( QObject* parent = arnNullptr);
178 QString pipePath()
const;
180 bool open(
const QString& pipePath);
196 bool setReceiver( QObject* receiver,
bool useTrackRpcSender =
true);
197 QObject* receiver()
const;
199 void setMethodPrefix(
const QString& prefix);
200 QString methodPrefix()
const;
205 void setIncludeSender(
bool v);
207 void setMode( Mode mode);
219 void setHeartBeatSend(
int time);
226 int getHeartBeatSend()
const;
233 void setHeartBeatCheck(
int time);
240 int getHeartBeatCheck()
const;
246 bool isHeartBeatOk()
const;
248 void addSenderSignals( QObject* sender,
const QString& prefix);
270 bool invoke(
const QString& funcName,
301 bool invoke(
const QString& funcName,
313 static ArnRpc* rpcSender( QObject* receiver);
329 static void batchConnect(
const QObject* sender,
const ARN_RegExp& rgx,
330 const QObject* receiver,
const QString& replace,
349 const QObject* receiver,
const QString& replace,
351 batchConnect(
this, rgx, receiver, replace, mode);
370 const QString& replace,
372 batchConnect( sender, rgx,
this, replace, mode);
376 bool isConvVariantPar()
const;
377 void setConvVariantPar(
bool convVariantPar);
392 void textReceived(
const QString& text);
399 void defaultCall(
const QByteArray& data);
402 void outOfSequence();
409 void heartBeatChanged(
bool isOk);
412 void heartBeatReceived();
420 void sendText(
const QString& txt);
423 void pipeInput(
const QByteArray& data);
425 void timeoutHeartBeatSend();
426 void timeoutHeartBeatCheck();
432 ArnRpc( ArnRpcPrivate& dd, QObject* parent);
433 ArnRpcPrivate*
const d_ptr;
438 const char* rpcTypeName;
439 const char* qtTypeName;
443 QGenericArgument arg;
461 isPositional =
false;
467 struct MethodsParam {
468 QList<QByteArray> methodNames;
474 QList<Params> paramTab;
479 bool xsmLoadArg(
const Arn::XStringMap& xsm, ArgInfo& argInfo,
int& index,
const QByteArray& methodName);
480 bool argLogic( ArgInfo* argInfo,
char* argOrder,
int& argc,
const QByteArray& methodName);
481 int argLogicFindMethod(
const ArgInfo* argInfo,
int argc,
const QByteArray& methodName);
482 bool checkConvVarPar(
const QByteArray& methodName,
int argc);
483 bool importArgData( ArgInfo& argInfo,
const QByteArray& methodName,
bool useVarPar);
486 void funcHelpMethod(
const QMetaMethod& method,
const QByteArray& name,
int parNumMin,
int flags);
489 void setupReceiverMethodsParam();
490 void deleteReceiverMethodsParam();
491 static bool hasSameParamNames(
const QMetaMethod& method1,
const QMetaMethod& method2);
492 static QByteArray methodSignature(
const QMetaMethod& method);
493 static const RpcTypeInfo& typeInfoFromRpc(
const QByteArray& rpcTypeName);
494 static const RpcTypeInfo& typeInfoFromQt(
const QByteArray& qtTypeName);
495 static const RpcTypeInfo& typeInfoFromId(
int typeId);
496 static const RpcTypeInfo& typeInfoNull();
498 static RpcTypeInfo _rpcTypeInfoTab[];
503 Q_DECLARE_METATYPE(
ArnRpc*)
Convenience, combined UuidPipe and AutoDestroy
When calling out, uses named argument e.g "myFunc count=123".
void batchConnect(const QObject *sender, const ARN_RegExp &rgx, const QString &replace, Mode mode=Mode())
Make batch connection from one senders signals to this ArnRpc:s slots/signals.
void batchConnect(const ARN_RegExp &rgx, const QObject *receiver, const QString &replace, Mode mode=Mode())
Make batch connection from this ArnRpc:s signals to another receivers slots/signals.
Container class with string representation for serialized data.
Only allow calling in with positional argument (typed)
#define MQ_DECLARE_FLAGSTXT(FEStruct)
Flags text.
#define MQ_DECLARE_FLAGS(FEStruct)
Flags.
Similar to QArgument but with added argument label (parameter name)
QList< QList< int > > methodIdsTab
When receiver method missing, send defaultCall() signal instead of error.
QList< QByteArray > paramNames
Check sequence order information from pipe. Can generate signal outOfSequence().
MQGenericArgument(const QGenericArgument &qgenArg)
Provider side (opposed to requester)
#define MQ_DECLARE_OPERATORS_FOR_FLAGS(FEStruct)
When calling out, uses named argument with type e.g "myFunc count:int=123".
const char * label() const
Send sequence order information to pipe.
MQGenericArgument(const char *aName=arnNullptr, const char *aLabel=arnNullptr, const void *aData=arnNullptr)
Use AutoDestroy for the pipe, i.e. it is closed when tcp/ip is broken.
QList< int > allMethodIds
Use an unique uuid in the pipe name.
ArnItem specialized as a pipe.
If guarantied no default arguments, full member name overload is ok.
#define ARNLIBSHARED_EXPORT
Similar to QGenericArgument but with added argument label (parameter name)
Convenience, combined NamedArg and NamedTypedArg
Debug mode, dumping info for the batch connections.
MQArgument(const char *aName, const char *aLabel, const T &aData)