ArnLib  4.0.x
Active Registry Network
ArnSapiQml Class Reference

ARN Sapi QML. More...

#include <ArnQml.hpp>

Inheritance diagram for ArnSapiQml:
Collaboration diagram for ArnSapiQml:

Public Types

enum  Mode {
  Provider = ArnRpc::Mode::Provider, AutoDestroy = ArnRpc::Mode::AutoDestroy, UuidPipe = ArnRpc::Mode::UuidPipe, NoDefaultArgs = ArnRpc::Mode::NoDefaultArgs,
  SendSequence = ArnRpc::Mode::SendSequence, CheckSequence = ArnRpc::Mode::CheckSequence, NamedArg = ArnRpc::Mode::NamedArg, NamedTypedArg = ArnRpc::Mode::NamedTypedArg,
  UseDefaultCall = ArnRpc::Mode::UseDefaultCall, UuidAutoDestroy = int(UuidPipe) | int(AutoDestroy)
}
 
- Public Types inherited from ArnRpc
typedef ArnRpcMode Mode
 

Public Slots

bool isHeartBeatOk ()
 
- Public Slots inherited from ArnRpc
void sendText (const QString &txt)
 Send a general text message to the other end of the used pipe More...
 

Properties

QString pipePath
 Path of the pipe for this Sapi. More...
 
Mode mode
 Sapi modes. More...
 
QObject receiver
 The receiving object of incomming Sapi calls. Default: parent. More...
 
int heartBeatSend
 Period time for sending heart beat message. More...
 
int heartBeatCheck
 Max time period for receiving heart beat message. More...
 

Additional Inherited Members

- Signals inherited from ArnRpc
void pipeClosed ()
 Signal emitted when the used pipe is closed. More...
 
void textReceived (const QString &text)
 Signal emitted when a general text message is received. More...
 
void defaultCall (const QByteArray &data)
 Signal emitted when receiver method missing. More...
 
void outOfSequence ()
 Signal emitted when checked sequence order is wrong. More...
 
void heartBeatChanged (bool isOk)
 Signal emitted when Heart beat changes state. More...
 
void heartBeatReceived ()
 Signal emitted when Heart beat message is received. More...
 
- Public Member Functions inherited from ArnRpc
 ArnRpc (QObject *parent=arnNullptr)
 
 ~ArnRpc ()
 
QString pipePath () const
 Get the path for the used pipe More...
 
bool open (const QString &pipePath)
 
void setPipe (ArnPipe *pipe)
 Set pipe for this Rpc. More...
 
ArnPipepipe () const
 Get the used pipe More...
 
bool setReceiver (QObject *receiver, bool useTrackRpcSender=true)
 
QObject * receiver () const
 
void setMethodPrefix (const QString &prefix)
 
QString methodPrefix () const
 
void setIncludeSender (bool v)
 Add sender as argument when calling a rpc method. More...
 
void setMode (Mode mode)
 
Mode mode () const
 Get the mode. More...
 
void setHeartBeatSend (int time)
 Set period time for sending heart beat message. More...
 
int getHeartBeatSend () const
 Get period time for sending heart beat message. More...
 
void setHeartBeatCheck (int time)
 Set max time period for receiving heart beat message. More...
 
int getHeartBeatCheck () const
 Get max time period for receiving heart beat message. More...
 
bool isHeartBeatOk () const
 Get the state of heart beat. More...
 
void addSenderSignals (QObject *sender, const QString &prefix)
 
bool invoke (const QString &funcName, MQGenericArgument val0=MQGenericArgument(0), MQGenericArgument val1=MQGenericArgument(), MQGenericArgument val2=MQGenericArgument(), MQGenericArgument val3=MQGenericArgument(), MQGenericArgument val4=MQGenericArgument(), MQGenericArgument val5=MQGenericArgument(), MQGenericArgument val6=MQGenericArgument(), MQGenericArgument val7=MQGenericArgument())
 Calls a named remote procedure. More...
 
bool invoke (const QString &funcName, Invoke invokeFlags, MQGenericArgument val0=MQGenericArgument(0), MQGenericArgument val1=MQGenericArgument(), MQGenericArgument val2=MQGenericArgument(), MQGenericArgument val3=MQGenericArgument(), MQGenericArgument val4=MQGenericArgument(), MQGenericArgument val5=MQGenericArgument(), MQGenericArgument val6=MQGenericArgument(), MQGenericArgument val7=MQGenericArgument())
 Calls a named remote procedure using invoke flags. More...
 
ArnRpcrpcSender ()
 
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. More...
 
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. More...
 
- Static Public Member Functions inherited from ArnRpc
static ArnRpcrpcSender (QObject *receiver)
 
static void batchConnect (const QObject *sender, const ARN_RegExp &rgx, const QObject *receiver, const QString &replace, Mode mode=Mode())
 Make batch connection from one senders signals to another receivers slots/signals. More...
 

Detailed Description

ARN Sapi QML.

This class is the Qml version of the ArnSapi.

See also
ArnQml

Example usage

// In Qml
//
import QtQuick 2.0
import ArnLib 1.0
Rectangle {
width: 370; height: 400
Item {
id: sapiTest
pipePath: "//Test/pipe"
mode: ArnSapi.NamedArg
}
// Provider API
signal pv_readFileTest( string fileName)
// Requester API
signal rq_test2( string par1)
function rq_test( p1) {
console.log("rq_test: p1=" + p1);
}
Component.onCompleted: {
sapiTest.rq_test2.connect( info.setTestMsg);
sapiTest.pv_readFileTest("myfile");
}
}
Rectangle {
id: info
property string testMsg: ""
anchors.bottom: parent.bottom; anchors.left: parent.left; anchors.right: parent.right
height: 80
Column {
anchors.fill: parent;
Text {text: "Msg: " + info.testMsg}
Text {text: Arn.info} // ArnLib version info
}
function setTestMsg( msg) {
info.testMsg = msg;
}
}
}

Definition at line 551 of file ArnQml.hpp.

Member Enumeration Documentation

◆ Mode

Enumerator
Provider 

Provider side (opposed to requester)

AutoDestroy 

Use AutoDestroy for the pipe, i.e. it is closed when tcp/ip is broken.

UuidPipe 

Use an unique uuid in the pipe name.

NoDefaultArgs 

If guarantied no default arguments, full member name overload is ok.

SendSequence 

Send sequence order information to pipe.

CheckSequence 

Check sequence order information from pipe. Can generate signal outOfSequence().

NamedArg 

When calling out, uses named argument e.g "myFunc count=123".

NamedTypedArg 

When calling out, uses named argument with type e.g "myFunc count:int=123".

UseDefaultCall 

When receiver method missing, send defaultCall() signal instead of error.

UuidAutoDestroy 

Convenience, combined UuidPipe and AutoDestroy

Definition at line 578 of file ArnQml.hpp.

Member Function Documentation

◆ isHeartBeatOk

bool ArnSapiQml::isHeartBeatOk ( )
inlineslot

Definition at line 603 of file ArnQml.hpp.

Property Documentation

◆ heartBeatCheck

int ArnSapiQml::heartBeatCheck
readwrite

Max time period for receiving heart beat message.

See also
ArnRpc::setHeartBeatCheck()

Definition at line 576 of file ArnQml.hpp.

◆ heartBeatSend

int ArnSapiQml::heartBeatSend
readwrite

Period time for sending heart beat message.

See also
ArnRpc::setHeartBeatSend()

Definition at line 571 of file ArnQml.hpp.

◆ mode

Mode ArnSapiQml::mode
readwrite

Sapi modes.

Definition at line 564 of file ArnQml.hpp.

◆ pipePath

QString ArnSapiQml::pipePath
readwrite

Path of the pipe for this Sapi.

Definition at line 562 of file ArnQml.hpp.

◆ receiver

QObject ArnSapiQml::receiver
readwrite

The receiving object of incomming Sapi calls. Default: parent.

Definition at line 566 of file ArnQml.hpp.


The documentation for this class was generated from the following files: