mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Remove FormatSerializerRegister as it is unused
This commit is contained in:
parent
031085b384
commit
8792824960
5 changed files with 3 additions and 70 deletions
|
@ -1,29 +0,0 @@
|
|||
//
|
||||
// FormatSerializerRegister.cpp
|
||||
// libraries/hfm/src/hfm
|
||||
//
|
||||
// Created by Sabrina Shanman on 2018/12/07.
|
||||
// Copyright 2018 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
|
||||
//
|
||||
|
||||
#include "FormatSerializerRegister.h"
|
||||
|
||||
#include "ModelFormatRegistry.h"
|
||||
|
||||
namespace hfm {
|
||||
|
||||
DoFormatSerializerRegister::DoFormatSerializerRegister(const MediaType& mediaType, std::unique_ptr<Serializer::Factory> factory) {
|
||||
auto registry = DependencyManager::get<ModelFormatRegistry>();
|
||||
_mediaTypeID = registry->_hfmFormatRegistry.registerMediaType(mediaType, std::move(factory));
|
||||
}
|
||||
|
||||
void DoFormatSerializerRegister::unregisterFormat() {
|
||||
auto registry = DependencyManager::get<ModelFormatRegistry>();
|
||||
registry->_hfmFormatRegistry.unregisterMediaType(_mediaTypeID);
|
||||
_mediaTypeID = hfm::FormatRegistry::INVALID_MEDIA_TYPE_ID;
|
||||
}
|
||||
|
||||
};
|
|
@ -1,35 +0,0 @@
|
|||
//
|
||||
// FormatSerializerRegister.h
|
||||
// libraries/hfm/src/hfm
|
||||
//
|
||||
// Created by Sabrina Shanman on 2018/11/30.
|
||||
// Copyright 2018 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
|
||||
//
|
||||
|
||||
#ifndef hifi_HFMFormat_h
|
||||
#define hifi_HFMFormat_h
|
||||
|
||||
#include "HFMFormatRegistry.h"
|
||||
#include "HFMSerializer.h"
|
||||
|
||||
namespace hfm {
|
||||
// A helper class which allows early de-registration of a Serializer from ModelFormatRegistry
|
||||
class FormatSerializerRegister {
|
||||
public:
|
||||
virtual void unregisterFormat() = 0;
|
||||
};
|
||||
|
||||
class DoFormatSerializerRegister : public FormatSerializerRegister {
|
||||
public:
|
||||
DoFormatSerializerRegister(const MediaType& mediaType, std::unique_ptr<Serializer::Factory> factory);
|
||||
|
||||
void unregisterFormat() override;
|
||||
protected:
|
||||
FormatRegistry::MediaTypeID _mediaTypeID { FormatRegistry::INVALID_MEDIA_TYPE_ID };
|
||||
};
|
||||
};
|
||||
|
||||
#endif // hifi_HFMFormat_h
|
|
@ -11,8 +11,8 @@
|
|||
|
||||
#include "ModelFormatRegistry.h"
|
||||
|
||||
std::unique_ptr<hfm::FormatSerializerRegister> ModelFormatRegistry::addFormat(const hfm::Serializer& serializer) {
|
||||
return std::make_unique<hfm::DoFormatSerializerRegister>(serializer.getMediaType(), serializer.getFactory());
|
||||
void ModelFormatRegistry::addFormat(const hfm::Serializer& serializer) {
|
||||
_hfmFormatRegistry.registerMediaType(serializer.getMediaType(), std::move(serializer.getFactory()));
|
||||
}
|
||||
|
||||
std::shared_ptr<hfm::Serializer> ModelFormatRegistry::getSerializerForMediaType(const hifi::ByteArray& data, const hifi::URL& url, const std::string& webMediaType) const {
|
||||
|
|
|
@ -12,18 +12,16 @@
|
|||
#ifndef hifi_ModelFormatRegistry_h
|
||||
#define hifi_ModelFormatRegistry_h
|
||||
|
||||
#include "FormatSerializerRegister.h"
|
||||
#include "HFMFormatRegistry.h"
|
||||
|
||||
#include <DependencyManager.h>
|
||||
|
||||
class ModelFormatRegistry : public Dependency {
|
||||
public:
|
||||
std::unique_ptr<hfm::FormatSerializerRegister> addFormat(const hfm::Serializer& serializer);
|
||||
void addFormat(const hfm::Serializer& serializer);
|
||||
std::shared_ptr<hfm::Serializer> getSerializerForMediaType(const hifi::ByteArray& data, const hifi::URL& url, const std::string& webMediaType) const;
|
||||
|
||||
protected:
|
||||
friend class hfm::DoFormatSerializerRegister;
|
||||
hfm::FormatRegistry _hfmFormatRegistry;
|
||||
};
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "FBXSerializer.h"
|
||||
#include "TextureCache.h"
|
||||
#include "ModelLoader.h"
|
||||
#include "hfm/FormatSerializerRegister.h"
|
||||
|
||||
// Alias instead of derive to avoid copying
|
||||
|
||||
|
|
Loading…
Reference in a new issue