Adding more parsing functions

This commit is contained in:
Brad Davis 2015-10-09 17:30:46 -07:00
parent c3775623aa
commit 78624679ed
6 changed files with 50 additions and 11 deletions

View file

@ -37,5 +37,9 @@ namespace Controllers {
};
Filter::Pointer Filter::parse(const QJsonObject& json) {
// FIXME parse the json object and determine the instance type to create
return Filter::Pointer();
}
}

View file

@ -13,6 +13,8 @@
#include <list>
#include <memory>
class QJsonObject;
namespace Controllers {
// Encapsulates part of a filter chain
@ -22,6 +24,8 @@ namespace Controllers {
using Pointer = std::shared_ptr<Filter>;
using List = std::list<Pointer>;
static Filter::Pointer parse(const QJsonObject& json);
};
}

View file

@ -1,9 +1,4 @@
#include "Mapping.h"
#include <QtCore/QObject>
#include <QtScript/QScriptValue>
extern float currentTime();
namespace Controllers {
}

View file

@ -1,15 +1,11 @@
#include <map>
#include <list>
#include <QtCore/QObject>
#include <QtScript/QScriptValue>
extern float currentTime();
#include "Endpoint.h"
#include "Filter.h"
#include "Route.h"
class QString;
namespace Controllers {
using ValueMap = std::map<Endpoint::Pointer, float>;

View file

@ -0,0 +1,36 @@
//
// Created by Bradley Austin Davis 2015/10/09
// Copyright 2015 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#pragma once
#ifndef hifi_Controllers_Route_h
#define hifi_Controllers_Route_h
#include "Endpoint.h"
#include "Filter.h"
class QJsonObject;
namespace Controllers {
/*
* encapsulates a source, destination and filters to apply
*/
class Route {
public:
Endpoint::Pointer _source;
Endpoint::Pointer _destination;
Filter::List _filters;
using Pointer = std::shared_ptr<Route>;
using List = std::list<Pointer>;
void parse(const QJsonObject& json);
};
}
#endif

View file

@ -13,6 +13,8 @@
#include "Endpoint.h"
#include "Filter.h"
class QJsonObject;
namespace Controllers {
/*
@ -26,6 +28,8 @@ namespace Controllers {
using Pointer = std::shared_ptr<Route>;
using List = std::list<Pointer>;
void parse(const QJsonObject);
};
}