NOTICK - Move CompositeFactory into amqp::internal namespace

This commit is contained in:
Katelyn Baker
2019-08-17 16:11:58 +01:00
parent 2ba8676013
commit 3c3f5f5e04
5 changed files with 83 additions and 37 deletions

View File

@ -1,48 +0,0 @@
#pragma once
/******************************************************************************/
#include <map>
#include <set>
#include "types.h"
#include "amqp/schema/Schema.h"
#include "amqp/schema/Envelope.h"
#include "amqp/schema/Composite.h"
#include "amqp/consumer/PropertyReader.h"
#include "amqp/consumer/CompositeReader.h"
/******************************************************************************/
class CompositeFactory {
private :
using SchemaPtr = uPtr<amqp::internal::schema::Schema>;
using CompositePtr = uPtr<amqp::internal::schema::Composite>;
using EnvelopePtr = uPtr<amqp::internal::schema::Envelope>;
/**
*
*/
spStrMap_t<amqp::Reader> m_readersByType;
spStrMap_t<amqp::Reader> m_readersByDescriptor;
public :
CompositeFactory() = default;
void process (const SchemaPtr &);
const std::shared_ptr<amqp::Reader> byType (const std::string &);
const std::shared_ptr<amqp::Reader> byDescriptor (const std::string &);
private :
std::shared_ptr<amqp::Reader> process(const amqp::internal::schema::AMQPTypeNotation &);
std::shared_ptr<amqp::Reader>
processComposite (const amqp::internal::schema::AMQPTypeNotation &);
std::shared_ptr<amqp::Reader>
processRestricted (const amqp::internal::schema::AMQPTypeNotation &);
};
/******************************************************************************/

View File

@ -0,0 +1,32 @@
#pragma once
/******************************************************************************/
#include <map>
#include <set>
#include "types.h"
#include "amqp/schema/Schema.h"
#include "amqp/schema/Envelope.h"
#include "amqp/schema/Composite.h"
#include "amqp/consumer/PropertyReader.h"
#include "amqp/consumer/CompositeReader.h"
/******************************************************************************/
class ICompositeFactory {
public :
using SchemaPtr = uPtr<amqp::internal::schema::Schema>;
ICompositeFactory() = default;
virtual ~ICompositeFactory() = default;
virtual void process (const SchemaPtr &) = 0;
virtual const std::shared_ptr<amqp::Reader> byType (const std::string &) = 0;
virtual const std::shared_ptr<amqp::Reader> byDescriptor (const std::string &) = 0;
};
/******************************************************************************/