ArnLib  4.0.x
Active Registry Network
Arn Namespace Reference

Classes

struct  _InitEnumTxt
 
struct  _InitSubEnum
 
class  Allow
 
struct  ClientSyncMode
 The Client session Sync mode at connect & reconnect. More...
 
struct  Coding
 
class  DataType
 Data type of an Arn Data Object More...
 
class  EnumTxt
 Class Enum text. More...
 
class  ExportCode
 Code used in blob for arnExport() and arnImport() More...
 
struct  InfoType
 Info type for exchange static (meta) info between ArnClient and ArnServer. More...
 
struct  LinkFlags
 Link flags when accessing an Arn Data Object More...
 
struct  NameF
 
class  ObjectMode
 
class  ObjectSyncMode
 
class  QmlMFileIO
 
class  QmlMQtObject
 
class  QmlMSys
 
struct  SameValue
 Action when assigning same value to an ArnItem. More...
 
class  XStringMap
 Container class with string representation for serialized data. More...
 
class  XStringMapOptions
 
class  XStringMapQml
 

Functions

QString convertName (const QString &name, Arn::NameF nameF=Arn::NameF())
 Convert a name to a specific format. More...
 
QString fullPath (const QString &path)
 Convert a path to a full absolute path. More...
 
QString itemName (const QString &path)
 The last part of a path More...
 
QString childPath (const QString &parentPath, const QString &posterityPath)
 Get substring for child from a path (posterityPath) More...
 
QString changeBasePath (const QString &oldBasePath, const QString &newBasePath, const QString &path)
 Change the base (start) of a path. More...
 
QString makePath (const QString &parentPath, const QString &itemName)
 Make a path from a parent and an item name. More...
 
QString addPath (const QString &parentPath, const QString &childRelPath, Arn::NameF nameF=Arn::NameF::EmptyOk)
 Make a path from a parent and an additional relative path. More...
 
QString convertPath (const QString &path, Arn::NameF nameF=Arn::NameF::EmptyOk)
 Convert a path to a specific format. More...
 
QString parentPath (const QString &path)
 Get the parent to a given path More...
 
QString twinPath (const QString &path)
 Get the bidirectional twin to a given path More...
 
QString providerPathIf (const QString &path, bool giveProviderPath=true)
 Get provider path or requester path More...
 
bool isFolderPath (const QString &path)
 Test if path is a folder path More...
 
bool isProviderPath (const QString &path)
 Test if path is a provider path More...
 
QString uuidPath (const QString &path)
 Get a path to an Arn Object with a unique uuid name. More...
 
QString makeHostWithInfo (const QString &host, const QString &info)
 Make a combined host and info string, i.e. HostWithInfo More...
 
QString hostFromHostWithInfo (const QString &hostWithInfo)
 Get the host from the HostWithInfo string. More...
 
bool isNullPtr (const void *ptr)
 
uint rand ()
 
int _mod_i (int x, int y)
 
qlonglong _mod_ll (qlonglong x, qlonglong y)
 
int _log2_u (uint x)
 
int _log2_ull (qulonglong x)
 
template<typename T >
mod (T x, T y)
 
template<typename T >
circVal (T x, T lo, T hi)
 
template<typename T >
bool isPower2 (T x)
 
template<typename T >
int log2 (T x)
 
template<typename T >
minLim (const T &x, const T &lim)
 
template<typename T >
maxLim (const T &x, const T &lim)
 
template<typename T >
rangeLim (const T &x, const T &min, const T &max)
 

Variables

const QString pathLocal = "/Local/"
 
const QString pathLocalSys = "Sys/"
 
const QString pathDiscover = "Sys/Discover/"
 
const QString pathDiscoverThis = "Sys/Discover/This/"
 
const QString pathDiscoverConnect = "Sys/Discover/Connect/"
 
const QString pathServer = "Sys/Server/"
 
const QString pathServerSessions = "Sys/Server/Sessions/"
 
bool debugSizes = false
 
bool debugThreading = false
 
bool debugLinkRef = false
 
bool debugLinkDestroy = false
 
bool debugRecInOut = false
 
bool debugShareObj = false
 
bool debugMonitor = false
 
bool debugMonitorTest = false
 
bool debugRPC = false
 
bool debugDepend = false
 
bool debugQmlNetwork = false
 
bool debugDiscover = false
 
bool debugZeroConf = false
 
bool debugMDNS = false
 
bool warningMDNS = false
 
bool offHeartbeat = false
 
const QString resourceArnLib = ":/ArnLib/"
 
const QString resourceArnRoot = ":/ArnLib/ArnRoot/"
 
const quint16 defaultTcpPort = 2022
 

Function Documentation

◆ _log2_u()

int Arn::_log2_u ( uint  x)

Definition at line 86 of file ArnMath.cpp.

◆ _log2_ull()

int Arn::_log2_ull ( qulonglong  x)

Definition at line 98 of file ArnMath.cpp.

◆ _mod_i()

int Arn::_mod_i ( int  x,
int  y 
)

Definition at line 74 of file ArnMath.cpp.

◆ _mod_ll()

qlonglong Arn::_mod_ll ( qlonglong  x,
qlonglong  y 
)

Definition at line 80 of file ArnMath.cpp.

◆ addPath()

QString Arn::addPath ( const QString &  parentPath,
const QString &  childRelPath,
Arn::NameF  nameF = Arn::NameF::EmptyOk 
)

Make a path from a parent and an additional relative path.

parentPath don't have to end with a "/", if missing it's added.

Example: parentPath = "//Measure/", childRelPath = "depth/value" ==> return = "//Measure/depth/value"

Parameters
[in]parentPath
[in]childRelPath
[in]nameFis the path naming format
Returns
The path
See also
convertPath()

Definition at line 137 of file Arn.cpp.

◆ changeBasePath()

QString Arn::changeBasePath ( const QString &  oldBasePath,
const QString &  newBasePath,
const QString &  path 
)

Change the base (start) of a path.

oldBasePath and newBasePath don't have to end with a "/", if missing it's added. If path not starts with oldBasePath, path is returned. Otherwise the path is returned with its base changed from oldBasePath to newBasePath.

Example: path = "//Measure/depth/value", oldBasePath = "//Measure/", newBasePath = "/Measure/Tmp/" ==> return = "/Measure/Tmp/depth/value"

Parameters
[in]oldBasePath
[in]newBasePath
[in]path
Returns
The changed path

Definition at line 114 of file Arn.cpp.

◆ childPath()

QString Arn::childPath ( const QString &  parentPath,
const QString &  posterityPath 
)

Get substring for child from a path (posterityPath)

parentPath don't have to end with a "/", if missing it's added.

If posterityPath not starts with parentPath, QString() is returned. Otherwise given the posterityPath the child to parentPath is returned.

Example 1: posterityPath = "//Measure/depth/value", parentPath = "//Measure/" ==> return = "//Measure/depth/"

Example 2: posterityPath = "//Measure/depth/value", parentPath = "//Measure/depth/" ==> return = //Measure/depth/value"

Parameters
[in]parentPath
[in]posterityPath
Returns
The child path

Definition at line 100 of file Arn.cpp.

◆ circVal()

template<typename T >
T Arn::circVal ( x,
lo,
hi 
)

Definition at line 63 of file Math.hpp.

◆ convertName()

QString Arn::convertName ( const QString &  name,
Arn::NameF  nameF = Arn::NameF() 
)

Convert a name to a specific format.

Name is a sub part from a path. Example: name = "value/", nameF = NoFolderMark ==> return = "value"

Parameters
[in]name
[in]nameFis the path naming format
Returns
The converted name

Definition at line 54 of file Arn.cpp.

◆ convertPath()

QString Arn::convertPath ( const QString &  path,
Arn::NameF  nameF = Arn::NameF::EmptyOk 
)

Convert a path to a specific format.

Example: path = "//Measure/depth/value", nameF = Relative ==> return = "@/Measure/depth/value"

Parameters
[in]path
[in]nameFis the path naming format
Returns
The converted path

Definition at line 148 of file Arn.cpp.

◆ fullPath()

QString Arn::fullPath ( const QString &  path)

Convert a path to a full absolute path.

Example: path = "Measure/depth/value" ==> return = "/Local/Measure/depth/value"

Parameters
[in]path
Returns
The converted path full path

Definition at line 82 of file Arn.cpp.

◆ hostFromHostWithInfo()

QString Arn::hostFromHostWithInfo ( const QString &  hostWithInfo)

Get the host from the HostWithInfo string.

This is typically used to extract only the host part without information, to be used in e.g. QTcpSocket for connection to the host.

Example: hostWithInfo = "192.168.1.1 [myhost.local]" ==> return = "192.168.1.1"

Parameters
[in]hostWithInfoThe HostWithInfo string
Returns
The name or address of the host
See also
makeHostWithInfo()
Note
As the format of the HostWithInfo string can be changed in the future, allways use makeHostWithInfo() and hostFromHostWithInfo() for coding and decoding.

Definition at line 242 of file Arn.cpp.

◆ isFolderPath()

bool Arn::isFolderPath ( const QString &  path)

Test if path is a folder path

Parameters
[in]path
Return values
trueif path is a folder path, i.e. ends with a "/".

Definition at line 210 of file Arn.cpp.

◆ isNullPtr()

bool Arn::isNullPtr ( const void *  ptr)

Definition at line 253 of file Arn.cpp.

◆ isPower2()

template<typename T >
bool Arn::isPower2 ( x)

Definition at line 69 of file Math.hpp.

◆ isProviderPath()

bool Arn::isProviderPath ( const QString &  path)

Test if path is a provider path

About Bidirectional Arn Data Objects

Parameters
[in]path
Return values
trueif path is a provider path, i.e. ends with a "!".
Examples:
ArnDemoChatServer/MainWindow.cpp.

Definition at line 216 of file Arn.cpp.

◆ itemName()

QString Arn::itemName ( const QString &  path)

The last part of a path

Example: path = "//Measure/depth/value" ==> return = "value"

Parameters
[in]path
Returns
The itemName, i.e. the last part of the path after last "/"

Definition at line 90 of file Arn.cpp.

◆ log2()

template<typename T >
int Arn::log2 ( x)
inline

Definition at line 75 of file Math.hpp.

◆ makeHostWithInfo()

QString Arn::makeHostWithInfo ( const QString &  host,
const QString &  info 
)

Make a combined host and info string, i.e. HostWithInfo

This is typically used to pass some extra information about the host, but still be used for connection to the host.

ArnClient and alike accepts such HostWithInfo strings for connection. Hosts discovered using e.g. ArnDiscoverBrowser will be using the ip-address as host and the host name as info.
Example: host = "192.168.1.1", info = "myhost.local" ==> return = "192.168.1.1 [myhost.local]"

Parameters
[in]hostthe name or address of the host
[in]infois corresponding info for the host
Returns
The HostWithInfo string
See also
hostFromHostWithInfo()
Note
As the format of the HostWithInfo string can be changed in the future, allways use makeHostWithInfo() and hostFromHostWithInfo() for coding and decoding.

Definition at line 235 of file Arn.cpp.

◆ makePath()

QString Arn::makePath ( const QString &  parentPath,
const QString &  itemName 
)

Make a path from a parent and an item name.

parentPath don't have to end with a "/", if missing it's added. Empty folder itemName is allowed on returned path.

Example: parentPath = "//Measure/depth/", itemName = "value" ==> return = "//Measure/depth/value"

Parameters
[in]parentPath
[in]itemName
Returns
The path

Definition at line 128 of file Arn.cpp.

◆ maxLim()

template<typename T >
T Arn::maxLim ( const T &  x,
const T &  lim 
)

Definition at line 87 of file Math.hpp.

◆ minLim()

template<typename T >
T Arn::minLim ( const T &  x,
const T &  lim 
)

Definition at line 81 of file Math.hpp.

◆ mod()

template<typename T >
T Arn::mod ( x,
y 
)
inline

Definition at line 56 of file Math.hpp.

◆ parentPath()

QString Arn::parentPath ( const QString &  path)

Get the parent to a given path

Example: path = "//Measure/depth/value!" ==> return = "//Measure/depth/"

Parameters
[in]path
Returns
The parent path

Definition at line 183 of file Arn.cpp.

◆ providerPathIf()

QString Arn::providerPathIf ( const QString &  path,
bool  giveProviderPath = true 
)

Get provider path or requester path

About Bidirectional Arn Data Objects

Parameters
[in]pathto be converted
[in]giveProviderPathchoses between provider and requester path. false = requester path, default is true = provider path.
Return values
isprovider path or requester path
See also
twinPath()
isProviderPath()

Definition at line 204 of file Arn.cpp.

◆ rand()

uint Arn::rand ( )

Definition at line 259 of file Arn.cpp.

◆ rangeLim()

template<typename T >
T Arn::rangeLim ( const T &  x,
const T &  min,
const T &  max 
)

Definition at line 93 of file Math.hpp.

◆ twinPath()

QString Arn::twinPath ( const QString &  path)

Get the bidirectional twin to a given path

Example: path = "//Measure/depth/value!" ==> return = "//Measure/depth/value"

Parameters
[in]path
Returns
The twin path
See also
Bidirectional Arn Data Objects

Definition at line 195 of file Arn.cpp.

◆ uuidPath()

QString Arn::uuidPath ( const QString &  path)

Get a path to an Arn Object with a unique uuid name.

Parameters
[in]pathThe prefix for Arn uuid path e.g. "//Names/name"
Returns
the unique path

Definition at line 222 of file Arn.cpp.

Variable Documentation

◆ debugDepend

bool Arn::debugDepend = false

Definition at line 46 of file ArnLib.cpp.

◆ debugDiscover

bool Arn::debugDiscover = false

Definition at line 48 of file ArnLib.cpp.

◆ debugLinkDestroy

bool Arn::debugLinkDestroy = false

Definition at line 40 of file ArnLib.cpp.

◆ debugLinkRef

bool Arn::debugLinkRef = false

Definition at line 39 of file ArnLib.cpp.

◆ debugMDNS

bool Arn::debugMDNS = false

Definition at line 50 of file ArnLib.cpp.

◆ debugMonitor

bool Arn::debugMonitor = false

Definition at line 43 of file ArnLib.cpp.

◆ debugMonitorTest

bool Arn::debugMonitorTest = false

Definition at line 44 of file ArnLib.cpp.

◆ debugQmlNetwork

bool Arn::debugQmlNetwork = false

Definition at line 47 of file ArnLib.cpp.

◆ debugRecInOut

bool Arn::debugRecInOut = false

Definition at line 41 of file ArnLib.cpp.

◆ debugRPC

bool Arn::debugRPC = false

Definition at line 45 of file ArnLib.cpp.

◆ debugShareObj

bool Arn::debugShareObj = false

Definition at line 42 of file ArnLib.cpp.

◆ debugSizes

bool Arn::debugSizes = false

Definition at line 37 of file ArnLib.cpp.

◆ debugThreading

bool Arn::debugThreading = false

Definition at line 38 of file ArnLib.cpp.

◆ debugZeroConf

bool Arn::debugZeroConf = false

Definition at line 49 of file ArnLib.cpp.

◆ defaultTcpPort

const quint16 Arn::defaultTcpPort = 2022

Definition at line 50 of file Arn.hpp.

◆ offHeartbeat

bool Arn::offHeartbeat = false

Definition at line 52 of file ArnLib.cpp.

◆ pathDiscover

const QString Arn::pathDiscover = "Sys/Discover/"

Definition at line 47 of file Arn.cpp.

◆ pathDiscoverConnect

const QString Arn::pathDiscoverConnect = "Sys/Discover/Connect/"

Definition at line 49 of file Arn.cpp.

◆ pathDiscoverThis

const QString Arn::pathDiscoverThis = "Sys/Discover/This/"

Definition at line 48 of file Arn.cpp.

◆ pathLocal

const QString Arn::pathLocal = "/Local/"

Definition at line 45 of file Arn.cpp.

◆ pathLocalSys

const QString Arn::pathLocalSys = "Sys/"

Definition at line 46 of file Arn.cpp.

◆ pathServer

const QString Arn::pathServer = "Sys/Server/"

Definition at line 50 of file Arn.cpp.

◆ pathServerSessions

const QString Arn::pathServerSessions = "Sys/Server/Sessions/"

Definition at line 51 of file Arn.cpp.

◆ resourceArnLib

const QString Arn::resourceArnLib = ":/ArnLib/"

Definition at line 54 of file ArnLib.cpp.

◆ resourceArnRoot

const QString Arn::resourceArnRoot = ":/ArnLib/ArnRoot/"

Definition at line 55 of file ArnLib.cpp.

◆ warningMDNS

bool Arn::warningMDNS = false

Definition at line 51 of file ArnLib.cpp.