mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 11:28:03 +02:00
removed sys/time.h for Systime.h on windows
This commit is contained in:
parent
731209d8cb
commit
a5c5a35c12
1 changed files with 20 additions and 16 deletions
|
@ -9,7 +9,11 @@
|
||||||
#ifndef __hifi__Assignment__
|
#ifndef __hifi__Assignment__
|
||||||
#define __hifi__Assignment__
|
#define __hifi__Assignment__
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include "Systime.h"
|
||||||
|
#else
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <QtCore/QUuid>
|
#include <QtCore/QUuid>
|
||||||
|
|
||||||
|
@ -22,7 +26,7 @@ const int MAX_ASSIGNMENT_POOL_BYTES = 64 + sizeof('\0');
|
||||||
class Assignment : public NodeData {
|
class Assignment : public NodeData {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
|
||||||
enum Type {
|
enum Type {
|
||||||
AudioMixerType,
|
AudioMixerType,
|
||||||
AvatarMixerType,
|
AvatarMixerType,
|
||||||
|
@ -32,20 +36,20 @@ public:
|
||||||
MetavoxelServerType,
|
MetavoxelServerType,
|
||||||
AllTypes
|
AllTypes
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Command {
|
enum Command {
|
||||||
CreateCommand,
|
CreateCommand,
|
||||||
DeployCommand,
|
DeployCommand,
|
||||||
RequestCommand
|
RequestCommand
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Location {
|
enum Location {
|
||||||
GlobalLocation,
|
GlobalLocation,
|
||||||
LocalLocation
|
LocalLocation
|
||||||
};
|
};
|
||||||
|
|
||||||
static Assignment::Type typeForNodeType(NODE_TYPE nodeType);
|
static Assignment::Type typeForNodeType(NODE_TYPE nodeType);
|
||||||
|
|
||||||
Assignment();
|
Assignment();
|
||||||
Assignment(Assignment::Command command,
|
Assignment(Assignment::Command command,
|
||||||
Assignment::Type type,
|
Assignment::Type type,
|
||||||
|
@ -53,48 +57,48 @@ public:
|
||||||
Assignment::Location location = Assignment::LocalLocation);
|
Assignment::Location location = Assignment::LocalLocation);
|
||||||
Assignment(const Assignment& otherAssignment);
|
Assignment(const Assignment& otherAssignment);
|
||||||
Assignment& operator=(const Assignment &rhsAssignment);
|
Assignment& operator=(const Assignment &rhsAssignment);
|
||||||
|
|
||||||
void swap(Assignment& otherAssignment);
|
void swap(Assignment& otherAssignment);
|
||||||
|
|
||||||
/// Constructs an Assignment from the data in the buffer
|
/// Constructs an Assignment from the data in the buffer
|
||||||
/// \param dataBuffer the source buffer to un-pack the assignment from
|
/// \param dataBuffer the source buffer to un-pack the assignment from
|
||||||
/// \param numBytes the number of bytes left to read in the source buffer
|
/// \param numBytes the number of bytes left to read in the source buffer
|
||||||
Assignment(const unsigned char* dataBuffer, int numBytes);
|
Assignment(const unsigned char* dataBuffer, int numBytes);
|
||||||
|
|
||||||
void setUUID(const QUuid& uuid) { _uuid = uuid; }
|
void setUUID(const QUuid& uuid) { _uuid = uuid; }
|
||||||
const QUuid& getUUID() const { return _uuid; }
|
const QUuid& getUUID() const { return _uuid; }
|
||||||
void resetUUID() { _uuid = QUuid::createUuid(); }
|
void resetUUID() { _uuid = QUuid::createUuid(); }
|
||||||
|
|
||||||
Assignment::Command getCommand() const { return _command; }
|
Assignment::Command getCommand() const { return _command; }
|
||||||
Assignment::Type getType() const { return _type; }
|
Assignment::Type getType() const { return _type; }
|
||||||
Assignment::Location getLocation() const { return _location; }
|
Assignment::Location getLocation() const { return _location; }
|
||||||
|
|
||||||
uchar* getPayload() { return _payload; }
|
uchar* getPayload() { return _payload; }
|
||||||
int getNumPayloadBytes() const { return _numPayloadBytes; }
|
int getNumPayloadBytes() const { return _numPayloadBytes; }
|
||||||
void setPayload(const uchar *payload, int numBytes);
|
void setPayload(const uchar *payload, int numBytes);
|
||||||
|
|
||||||
void setPool(const char* pool);
|
void setPool(const char* pool);
|
||||||
const char* getPool() const { return _pool; }
|
const char* getPool() const { return _pool; }
|
||||||
bool hasPool() const { return (bool) strlen(_pool); }
|
bool hasPool() const { return (bool) strlen(_pool); }
|
||||||
|
|
||||||
int getNumberOfInstances() const { return _numberOfInstances; }
|
int getNumberOfInstances() const { return _numberOfInstances; }
|
||||||
void setNumberOfInstances(int numberOfInstances) { _numberOfInstances = numberOfInstances; }
|
void setNumberOfInstances(int numberOfInstances) { _numberOfInstances = numberOfInstances; }
|
||||||
void decrementNumberOfInstances() { --_numberOfInstances; }
|
void decrementNumberOfInstances() { --_numberOfInstances; }
|
||||||
|
|
||||||
const char* getTypeName() const;
|
const char* getTypeName() const;
|
||||||
|
|
||||||
/// Packs the assignment to the passed buffer
|
/// Packs the assignment to the passed buffer
|
||||||
/// \param buffer the buffer in which to pack the assignment
|
/// \param buffer the buffer in which to pack the assignment
|
||||||
/// \return number of bytes packed into buffer
|
/// \return number of bytes packed into buffer
|
||||||
int packToBuffer(unsigned char* buffer);
|
int packToBuffer(unsigned char* buffer);
|
||||||
|
|
||||||
// implement parseData to return 0 so we can be a subclass of NodeData
|
// implement parseData to return 0 so we can be a subclass of NodeData
|
||||||
int parseData(unsigned char* sourceBuffer, int numBytes) { return 0; }
|
int parseData(unsigned char* sourceBuffer, int numBytes) { return 0; }
|
||||||
|
|
||||||
friend QDebug operator<<(QDebug debug, const Assignment& assignment);
|
friend QDebug operator<<(QDebug debug, const Assignment& assignment);
|
||||||
friend QDataStream& operator<<(QDataStream &out, const Assignment& assignment);
|
friend QDataStream& operator<<(QDataStream &out, const Assignment& assignment);
|
||||||
friend QDataStream& operator>>(QDataStream &in, Assignment& assignment);
|
friend QDataStream& operator>>(QDataStream &in, Assignment& assignment);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QUuid _uuid; /// the 16 byte UUID for this assignment
|
QUuid _uuid; /// the 16 byte UUID for this assignment
|
||||||
Assignment::Command _command; /// the command for this assignment (Create, Deploy, Request)
|
Assignment::Command _command; /// the command for this assignment (Create, Deploy, Request)
|
||||||
|
|
Loading…
Reference in a new issue