Commit 8d8de61d authored by Pavel Vainerman's avatar Pavel Vainerman

Удалил лишнюю сущность ObjectRepositoryFactory, перенёс его функциональность

в класс ObjectRepository.
parent 24d1baff
......@@ -9,7 +9,6 @@
// --------------------------------------------------------------------------
#include "ORepHelpers.h"
#include "ObjectRepository.h"
#include "ObjectRepositoryFactory.h"
#include "Exceptions.h"
#include "UniSetObject.h"
#include "UniSetTypes.h"
......@@ -523,7 +522,7 @@ static bool commandToAll(const string& section, std::shared_ptr<ObjectRepository
// ==============================================================================================
static void createSections( const std::shared_ptr<UniSetTypes::Configuration>& rconf )
{
ObjectRepositoryFactory repf(rconf);
ObjectRepository repf(rconf);
repf.createRootSection(rconf->getRootSection());
repf.createRootSection(rconf->getSensorsSection());
......
......@@ -86,13 +86,32 @@ class ObjectRepository
};
//! Получение списка how_many объектов из секции section.
bool list(const std::string& section, UniSetTypes::ListObjectName* ls, unsigned int how_many = 300)throw(UniSetTypes::ORepFailed);
bool list(const std::string& section, UniSetTypes::ListObjectName* ls, size_t how_many = 300)throw(UniSetTypes::ORepFailed);
//! Получние списка how_many подсекций из секции in_section.
bool listSections(const std::string& in_section, UniSetTypes::ListObjectName* ls, unsigned int how_many = 300)throw(UniSetTypes::ORepFailed);
bool listSections(const std::string& in_section, UniSetTypes::ListObjectName* ls, size_t how_many = 300)throw(UniSetTypes::ORepFailed);
// -------------------------------------------------------------------
//! Создание секции
bool createSection( const std::string& name, const std::string& in_section )throw(UniSetTypes::ORepFailed, UniSetTypes::InvalidObjectName);
/*! Создание секции по полному имени */
bool createSectionF(const std::string& fullName)throw(UniSetTypes::ORepFailed, UniSetTypes::InvalidObjectName);
//! Функция создания секции в корневом 'каталоге'
bool createRootSection(const std::string& name);
//! Функция удаления секции
bool removeSection(const std::string& fullName, bool recursive = false);
//! Функция переименования секции
bool renameSection(const std::string& newName, const std::string& fullName);
/*! Функция выводящая на экран список всех объектов расположенных в данной секции */
void printSection(const std::string& fullName);
// @}
// end of ORepServiceGroup
// end of add to ORepServiceGroup
protected:
......@@ -102,6 +121,9 @@ class ObjectRepository
bool list(const std::string& section, UniSetTypes::ListObjectName* ls, unsigned int how_many, ObjectType type);
/*! Создание нового контекста(секции) */
bool createContext( const std::string& cname, CosNaming::NamingContext_ptr ctx);
private:
bool init() const;
mutable CosNaming::NamingContext_var localctx;
......
/*
* Copyright (c) 2015 Pavel Vainerman.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, version 2.1.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Lesser Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// --------------------------------------------------------------------------
/*! \file
* \brief Интерфейсный класс для создания структуры репозитария объектов
* \author Pavel Vainerman
*/
// --------------------------------------------------------------------------
#ifndef ObjectRepositoryFactory_H_
#define ObjectRepositoryFactory_H_
// --------------------------------------------------------------------------
#include <omniORB4/CORBA.h>
#include <omniORB4/Naming.hh>
#include "Exceptions.h"
#include "ObjectRepository.h"
// -----------------------------------------------------------------------------------------
//namespase ORepositoryFacotry
//{
/*!\class ObjectRepositoryFactory */
class ObjectRepositoryFactory: private ObjectRepository
{
public:
ObjectRepositoryFactory( const std::shared_ptr<UniSetTypes::Configuration>& conf );
~ObjectRepositoryFactory();
//! Создание секции
bool createSection(const std::string& name, const std::string& in_section)throw(UniSetTypes::ORepFailed, UniSetTypes::InvalidObjectName);
/*! Создание секции по полному имени */
bool createSectionF(const std::string& fullName)throw(UniSetTypes::ORepFailed, UniSetTypes::InvalidObjectName);
//! Функция создания секции в корневом 'каталоге'
bool createRootSection(const std::string& name);
//! Функция удаления секции
bool removeSection(const std::string& fullName, bool recursive = false);
//! Функция переименования секции
bool renameSection(const std::string& newName, const std::string& fullName);
/**
@addtogroup ORepServiceGroup
@{
*/
/*! Функция выводящая на экран список всех объектов расположенных в данной секции */
void printSection(const std::string& fullName);
// void printSection(CosNaming::NamingContext_ptr ctx);
// @}
// end of add to ORepServiceGroup
protected:
private:
/*! Создание нового контекста(секции) */
bool createContext( const std::string& cname, CosNaming::NamingContext_ptr ctx);
};
//};
#endif
......@@ -2,7 +2,7 @@ noinst_LTLIBRARIES = libObjectsRepository.la
libObjectsRepository_la_SOURCES = UniSetTypes_iSK.cc UniSetObject_iSK.cc UniSetTypes.cc \
UniSetManager_iSK.cc ObjectIndex.cc ObjectIndex_Array.cc ObjectIndex_XML.cc ObjectIndex_idXML.cc \
ORepHelpers.cc UniSetObject.cc UniSetManager.cc \
UniSetActivator.cc ObjectRepository.cc ObjectRepositoryFactory.cc \
UniSetActivator.cc ObjectRepository.cc \
ProxyManager.cc PassiveObject.cc IORFile.cc
# ServiceActivator.cc
......
......@@ -302,7 +302,6 @@ include/ObjectIndex_Array.h
include/ObjectIndex_idXML.h
include/ObjectIndex_XML.h
include/ObjectRepository.h
include/ObjectRepositoryFactory.h
include/OmniThreadCreator.h
include/ORepHelpers.h
include/PassiveObject.h
......@@ -396,7 +395,6 @@ src/ObjectRepository/ObjectIndex_Array.cc
src/ObjectRepository/ObjectIndex_idXML.cc
src/ObjectRepository/ObjectIndex_XML.cc
src/ObjectRepository/ObjectRepository.cc
src/ObjectRepository/ObjectRepositoryFactory.cc
src/ObjectRepository/ORepHelpers.cc
src/ObjectRepository/PassiveObject.cc
src/ObjectRepository/ProxyManager.cc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment