12 #ifndef hifi_Assignment_h
13 #define hifi_Assignment_h
15 #include <QtCore/QUuid>
18 #include "ReceivedMessage.h"
23 const int MAX_PAYLOAD_BYTES = 1024;
25 const QString emptyPool = QString();
38 MessagesMixerType = 4,
39 EntityScriptServerType = 5,
55 static Assignment::Type typeForNodeType(
NodeType_t nodeType);
59 Assignment::Type type,
60 const QString& pool = emptyPool,
61 Assignment::Location location = Assignment::LocalLocation,
62 QString dataDirectory = QString());
72 void setUUID(
const QUuid& uuid) { _uuid = uuid; }
73 const QUuid& getUUID()
const {
return _uuid; }
74 void resetUUID() { _uuid = QUuid::createUuid(); }
76 Assignment::Command getCommand()
const {
return _command; }
77 Assignment::Type getType()
const {
return _type; }
78 Assignment::Location getLocation()
const {
return _location; }
80 const QByteArray& getPayload()
const {
return _payload; }
81 void setPayload(
const QByteArray& payload) {
_payload = payload.left(MAX_PAYLOAD_BYTES); }
83 void setPool(
const QString& pool) {
_pool = pool; };
84 const QString& getPool()
const {
return _pool; }
86 void setIsStatic(
bool isStatic) {
_isStatic = isStatic; }
87 bool isStatic()
const {
return _isStatic; }
89 const QString& getNodeVersion()
const {
return _nodeVersion; }
91 const char* getTypeName()
const;
92 static const char* typeToString(Assignment::Type type);
94 friend QDebug operator<<(QDebug debug,
const Assignment& assignment);
95 friend QDataStream& operator<<(QDataStream &out,
const Assignment& assignment);
96 friend QDataStream& operator>>(QDataStream &in,
Assignment& assignment);
117 QString _dataDirectory;
120 uint qHash(
const Assignment::Type& key, uint seed);
quint8 NodeType_t
An 8-bit value identifying the type of a node - domain server, audio mixer, etc.
Definition: NodeType.h:22
Holds information used for request, creation, and deployment of assignments.
Definition: Assignment.h:28
QString _pool
the type of the assignment, defines what the assignee will do
Definition: Assignment.h:112
void commonParseSettingsObject(const QJsonObject &settingsObject)
Parse the part of the settings object common to all assignment clients.
Definition: Assignment.cpp:158
Assignment::Location _location
the destination pool for this assignment
Definition: Assignment.h:113
QByteArray _payload
the location of the assignment, allows a domain to preferentially use local ACs
Definition: Assignment.h:114
QString _nodeVersion
defines if this assignment needs to be re-queued in the domain-server if it stops being fulfilled
Definition: Assignment.h:116
Assignment::Command _command
the 16 byte UUID for this assignment
Definition: Assignment.h:110
bool _isStatic
an optional payload attached to this assignment, a maximum for 1024 bytes will be packed
Definition: Assignment.h:115
Assignment::Type _type
the command for this assignment (Create, Deploy, Request)
Definition: Assignment.h:111