Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • arf/world-storage-api-helpers/World-Storage-SolAR-wrapper
1 result
Show changes
Commits on Source (3)
Showing
with 700 additions and 20 deletions
*This repository is part of the outcomes of the Specialist Task Force 620 focusing on the authoring of a World Representation as part of the ETSI ISG Augmented Reality Framework architecture (https://www.etsi.org/deliver/etsi_gs/ARF/001_099/003/01.01.01_60/gs_ARF003v010101p.pdf).*
*The set of the World Representation authoring components includes:*
*• The C++ and C# source code for servers and clients generated from OpenAPI available here (https://forge.etsi.org/rep/arf/arf005)*
*• A Unity plugin and a Unity editor for authoring and accessing a World Representation hosted on a World Storage server.*
*All these components are available under the ETSI Labs group “World Storage API Helpers”: https://labs.etsi.org/rep/arf/world-storage-api-helpers*
*If you wish to contribute to this project or any other projects in the context of the [ETSI ISG Augmented Reality Framework architecture](https://www.etsi.org/committee/1420-arf), please refer to the ["How to get involved in an ISG" section on the ETSI website](https://www.etsi.org/how-to-get-involved-in-an-isg)*
*This repository is part of the outcomes of the Specialist Task Force 620 and 669 focusing on the authoring and use of a World Representation as part of the ETSI ISG Augmented Reality Framework architecture (https://www.etsi.org/deliver/etsi_gs/ARF/001_099/003/01.01.01_60/gs_ARF003v010101p.pdf).*
---
# <ins>SolARWorldStorage</ins>
## <ins>Server implementation using the SolAR world storage module</ins>
## <ins>SolAR module wrapping the C++ RestBed World Storage server and the C libcurl World Storage client</ins>
[![License](https://img.shields.io/github/license/SolARFramework/SolARModuleOpencv?style=flat-square&label=License)](https://www.apache.org/licenses/LICENSE-2.0)
The goal of the world storage server is to be able to store and fetch online all the elements needed to design and execute AR apps.
This server implements a [server partially generated by OpenAPI generator](https://labs.etsi.org/rep/arf/world-storage-api-helpers/world-storage-cpp-server.git), based on the ETSI specification and handles REST requests designed in the same ETSI specification file, [available on the ETSI forge](https://forge.etsi.org/rep/arf/arf005/-/blob/develop/API/openapi.yaml).
It uses the ETSIWorldStorage component of the Solar world storage module ([SolARModuleWorldStorage]((https://github.com/SolarFramework/SolARModuleWorldStorage/tree/develop))) as an implementation for SolAR framework's [IWorldGraphManager](https://github.com/SolarFramework/SolARFramework/blob/feature/WorldGraph/interfaces/api/storage/IWorldGraphManager.h).
The SolARModuleWorldGraph includes :
- The SolAR framework wrapping from the World Storage Server based on a C++ RestBed implementation [available on the ETSI labs](https://labs.etsi.org/rep/arf/world-storage-api-helpers/world-storage-cpp-server);
- The SolAR framework wrapping from the World Storage Client based on the C libcurl implementation [available on the ETSI labs](https://labs.etsi.org/rep/arf/world-storage-api-helpers/world-storage-c-client)
Both server and client are generated with OpenAPI generator from the World Graph OpenAPI specification verison 2.0.0 [available on the ETSI forge](https://forge.etsi.org/rep/arf/openapi)
![All the project's architecture](images/SchemaWrapper.png)
......@@ -31,12 +22,31 @@ All the classes in this project (except for the main and UnitSysConversion) are
Except for the `DefaultSolARImpl` class, that only has usages for when you want to check if the server is up and check the version, all of the request handling classes have the world storage singleton as an attribute. On which they will be able to call methods in response to requests.
The module is passsed down through the constructor to ensure the uniqueness of it.
## <ins>Server implementation using the SolAR world storage module</ins>
[![License](https://img.shields.io/github/license/SolARFramework/SolARModuleOpencv?style=flat-square&label=License)](https://www.apache.org/licenses/LICENSE-2.0)
The server is available in the *Service-WorldStorage* folder. It consists of a executable which is able to load and instantiate at runtime the World Storage Server component available in the SolAR World Graph Module, to start the server waiting for client requests, and answering these requests.
## <ins>Client implementation using the SolAR world storage module</ins>
[![License](https://img.shields.io/github/license/SolARFramework/SolARModuleOpencv?style=flat-square&label=License)](https://www.apache.org/licenses/LICENSE-2.0)
The server is available in the *Service-WorldStorage/tests* folder. It consists of a executable which is able to load and instantiate at runtime the World Storage Client component available in the SolAR World Graph Module, to to send requests to a World Storage server, and to display the result message.
## <ins>How to</ins>
To be able to compile and run this server, you need to:
- clone [the OpenAPI world storage](https://labs.etsi.org/rep/arf/world-storage-api-helpers/world-storage-cpp-server.git) project and then generate the code and export it as a library (follow the git's instructions)
- have [remaken](https://github.com/b-com-software-basis/remaken) installed
- clone [SolAR framework](https://github.com/SolarFramework/SolARFramework) (for now, as the work is not released yet, you will have to clone the [feature/WorldGraph](https://github.com/SolarFramework/SolARFramework/tree/feature/WorldGraph) branch), perform a `remaken install` in the source directory and finally build the project
- clone [the world storage module](https://github.com/SolarFramework/SolARModuleWorldStorage) (for now, as the work is not released yet, you will have to clone the [develop](https://github.com/SolarFramework/SolARModuleWorldStorage/tree/develop) branch) and build it
Once all those requirements are met, you should be able to compile your server and run it, you can try and send requests to http://localhost:8080 to try and see if it's working (e.g. POST request to see if the server is up : http://localhost:8080/ping)
- build the world storage module using qtCreator. Before opening the projet, run the following commands to install dependencies:
```
Remaken install
```
and
```
Remaken install -c debug
```
- then build the World Storage server as well as the client test.
- FInally, launch the server and the client binaries available in the folder *Service-WorldStorage\deploy\bin\x86_64\static\release*
You can also test the server by sending requests to http://localhost:8080.
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
build/
.build-rules/
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Visual Studio files
*.ib_pdb_index
*.idb
*.ilk
*.pdb
*.sln
*.suo
*.vcproj
*vcproj.*.*.user
*.vcxproj*
*.user
*.user.*
*.ncb
*.sdf
*.opensdf
*.vcxproj
*vcxproj.*
x64/
.vs/
*.bat
*remakeninfo.txt
Debug/
Release/
*-packagedependencies.*
*-packagedependencies-win.*
*-packagedependencies-linux.*
*-packagedependencies-unix.*
*-packagedependencies-android.*
*.pc
*-Debug
*-Release
# Executables
deploy/
*.exe
*.out
*.app
# Generated documentation
doc/
doxygen/
# Tests builds
tests/bin
# Others
*.*pre1
*.rej
*.stash
*.rc
*.res
*.exp
*.ilk
*.pdb
*.autosave
*.project
*.props
*.log
*.tlog
*.TMP
*.tmp
.git Merge
\ No newline at end of file
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
###############################################################################
# SolAR ARCloud
# (C) Copyright 2024 b<>com. All rights reserved.
#
# IDDN: FR.XXX.XXXXXX.XXX.X.X.XXXX.XXX.XXXXX
# This software is the confidential intellectual property of b<>com.
# You shall not disclose it and shall use it only in accordance with
# the terms of the license agreement you entered into with b<>com.
#
################################################################################
## remove Qt dependencies
QT -= core gui
CONFIG -= qt
QMAKE_PROJECT_DEPTH = 0
## global defintions : target lib name, version
TARGET = SolARService_WorldStorage
VERSION = 1.2.0
PROJECTDEPLOYDIR = $${PWD}/deploy
CONFIG += c++1z
CONFIG += console
DEFINES += MYVERSION=\"\\\"$${VERSION}\\\"\"
include(findremakenrules.pri)
win32:CONFIG -= static
win32:CONFIG += shared
QMAKE_TARGET.arch = x86_64 #must be defined prior to include
# Default rules for deployment.
#qnx: target.path = $${PWD}/bin/Debug# /tmp/$${TARGET}/bin
#else: unix:!android: target.path = /opt/$${TARGET}/bin
#!isEmpty(target.path): INSTALLS += target
DEPENDENCIESCONFIG = shared install_recurse
## Configuration for Visual Studio to install binaries and dependencies. Work also for QT Creator by replacing QMAKE_INSTALL
PROJECTCONFIG = QTVS
#NOTE : CONFIG as staticlib or sharedlib, DEPENDENCIESCONFIG as staticlib or sharedlib, QMAKE_TARGET.arch and PROJECTDEPLOYDIR MUST BE DEFINED BEFORE templatelibconfig.pri inclusion
include ($$shell_quote($$shell_path($${QMAKE_REMAKEN_RULES_ROOT}/templateappconfig.pri))) # Shell_quote & shell_path required for visual on windows
SOURCES += main.cpp
unix {
LIBS += -ldl
# Avoids adding install steps manually. To be commented to have a better control over them.
QMAKE_POST_LINK += "make install install_deps"
}
win32 {
QMAKE_LFLAGS += /MACHINE:X64
DEFINES += WIN64 UNICODE _UNICODE
QMAKE_COMPILER_DEFINES += _WIN64
QMAKE_CXXFLAGS += -wd4250 -wd4251 -wd4244 -wd4275
# Windows Kit (msvc2013 64)
LIBS += -L$$(WINDOWSSDKDIR)lib/winv6.3/um/x64 -lshell32 -lgdi32 -lComdlg32
INCLUDEPATH += $$(WINDOWSSDKDIR)lib/winv6.3/um/x64
}
config_files.path = $${TARGETDEPLOYDIR}
config_files.files= $$files($${PWD}/SolARService_World_Storage_conf.xml)
INSTALLS += config_files
DISTFILES += \
packagedependencies.txt
#NOTE : Must be placed at the end of the .pro
include ($$shell_quote($$shell_path($${QMAKE_REMAKEN_RULES_ROOT}/remaken_install_target.pri)))) # Shell_quote & shell_path required for visual on windows
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!--
SolAR ARCloud
(C) Copyright 2024 b<>com. All rights reserved.
IDDN: FR.001.020021.000.S.C.2024.000.00000
This software is the confidential intellectual property of b<>com.
You shall not disclose it and shall use it only in accordance with
the terms of the license agreement you entered into with b<>com.
-->
<xpcf-registry autoAlias="true">
<module uuid="be14ee99-b47b-46c4-92c8-8ec9f15e5ddd" name="SolARModuleWorldStorage" description="SolARModuleWorldStorage" path="$XPCF_MODULE_ROOT/SolARBuild/SolARModuleWorldStorage/1.3.0/lib/x86_64/shared">
<component uuid="58826213-806b-4569-9996-f18552acc2d7" name="ETSIWorldGraphManager" description="ETSIWorldGraphManager">
<interface uuid="125f2007-1bf9-421d-9367-fbdc1210d006" name="IComponentIntrospect" description="IComponentIntrospect"/>
<interface uuid="f8847b66-4bd0-48c6-ad54-e371a16fba1a" name="IWorldGraphManager" description="SolAR::api::storage::IWorldGraphManager defines the interface of a world graph manager and its representation with all its components such as trackables, worldanchors and their relations (3DF)."/>
</component>
<component uuid="b603990c-6596-4225-a5df-c0ac68ff8d16" name="ETSIWorldGraphService" description="ETSIWorldGraphService">
<interface uuid="125f2007-1bf9-421d-9367-fbdc1210d006" name="IComponentIntrospect" description="IComponentIntrospect"/>
<interface uuid="d193e3e4-54e8-44ff-b7f8-2ffdba2b04e9" name="IServiceWorldGraph" description="SolAR::api::service::IServiceWorldGraph defines the interface of of a service managing a World Graph."/>
</component>
</module>
<properties>
<configure component="ETSIWorldGraphService">
<property name="port" type="uint" value="8080"/>
<property name="serverNbThread" type="uint" value="2"/>
<property name="maxRequestSize" type="uint" value="32768"/>
<property name="maxResponseSize" type="uint" value="32768"/>
</configure>
<configure component="ETSIWorldGraphManager">
<property name="worldGraphPath" type="string" value="./worldGraph.wg"/>
<property name="automaticSave" type="bool" value="1"/>
</configure>
</properties>
</xpcf-registry>
Service-WorldStorage/images/AnchorMethods.png

49.8 KiB

Service-WorldStorage/images/DefaultMethods.png

11.7 KiB

Service-WorldStorage/images/HandleSetUp.png

39.3 KiB

Service-WorldStorage/images/LinkMethods.png

74.1 KiB

Service-WorldStorage/images/SchemaWrapper.png

338 KiB

Service-WorldStorage/images/ToUUID.png

5.52 KiB

Service-WorldStorage/images/TrackableMethods.png

54.4 KiB

Service-WorldStorage/images/WorldStorageServer.png

94.4 KiB

Service-WorldStorage/images/XPCFComponentManager.png

40.1 KiB

Service-WorldStorage/images/serverClasses.png

12.9 KiB

/**
* Copyright 2022 ETSI
* @copyright Copyright (c) 2021-2022 B-com http://www.b-com.com/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
......@@ -26,125 +26,76 @@
* Do not edit the class manually.
*/
#ifdef __linux__
#include <vector>
#include <signal.h>
#include <unistd.h>
#endif
#include <boost/log/core.hpp>
#include <core/Log.h>
#include <pistache/endpoint.h>
#include <pistache/http.h>
#include <pistache/router.h>
#include <xpcf/xpcf.h>
#include "TrackablesSolARImpl.h"
#include "WorldAnchorsSolARImpl.h"
#include "WorldLinksSolARImpl.h"
#include "DefaultSolARImpl.h"
#include <api/service/IServiceWorldGraph.h>
#define PISTACHE_SERVER_THREADS 2
#define PISTACHE_SERVER_MAX_REQUEST_SIZE 32768
#define PISTACHE_SERVER_MAX_RESPONSE_SIZE 32768
namespace xpcf = org::bcom::xpcf;
using namespace SolAR;
using namespace SolAR::api;
namespace xpcf = org::bcom::xpcf;
// Global service instance
SRef<service::IServiceWorldGraph> worldGraphService = 0;
static Pistache::Http::Endpoint *httpEndpoint;
#ifdef __linux__
static void sigHandler [[noreturn]] (int sig){
switch(sig){
case SIGINT:
case SIGQUIT:
case SIGTERM:
case SIGHUP:
default:
httpEndpoint->shutdown();
break;
}
exit(0);
}
// Function called when interruption signal is triggered to close the service.
static void SigInt(int /* signo */) {
static void setUpUnixSignals(std::vector<int> quitSignals) {
sigset_t blocking_mask;
sigemptyset(&blocking_mask);
for (auto sig : quitSignals)
sigaddset(&blocking_mask, sig);
LOG_INFO("\n\n===> Program interruption\n");
struct sigaction sa;
sa.sa_handler = sigHandler;
sa.sa_mask = blocking_mask;
sa.sa_flags = 0;
LOG_INFO("Stop World Graph Service");
for (auto sig : quitSignals)
sigaction(sig, &sa, nullptr);
}
#endif
if (worldGraphService != 0) {
worldGraphService->stop();
}
using namespace org::openapitools::server::implem;
using namespace SolAR;
LOG_INFO("World Graph Service stopped");
int main() {
exit(0);
}
#ifdef __linux__
std::vector<int> sigs{SIGQUIT, SIGINT, SIGTERM, SIGHUP};
setUpUnixSignals(sigs);
#endif
int main() {
try {
#if NDEBUG
boost::log::core::get()->set_logging_enabled(false);
#endif
#if NDEBUG
boost::log::core::get()->set_logging_enabled(false);
#endif
//init the logger
LOG_ADD_LOG_TO_CONSOLE();
LOG_INFO("program is running");
// Signal interruption function (Ctrl + C)
signal(SIGINT, SigInt);
/* instantiate component manager*/
/* this is needed in dynamic mode */
SRef<xpcf::IComponentManager> xpcfComponentManager = xpcf::getComponentManagerInstance();
if(xpcfComponentManager->load("SolARSample_World_Storage_conf.xml")!=org::bcom::xpcf::_SUCCESS)
if(xpcfComponentManager->load("SolARService_World_Storage_conf.xml")!=org::bcom::xpcf::_SUCCESS)
{
LOG_ERROR("Failed to load the configuration file SolARSample_World_Storage_conf.xml");
LOG_ERROR("Failed to load the configuration file SolARService_World_Storage_conf.xml");
return -1;
}
auto worldStorage = xpcfComponentManager->resolve<SolAR::api::storage::IWorldGraphManager>();
Pistache::Address addr(Pistache::Ipv4::any(), Pistache::Port(8080));
httpEndpoint = new Pistache::Http::Endpoint((addr));
auto router = std::make_shared<Pistache::Rest::Router>();
worldGraphService = xpcfComponentManager->resolve<service::IServiceWorldGraph>();
auto opts = Pistache::Http::Endpoint::options().threads(PISTACHE_SERVER_THREADS);
opts.flags(Pistache::Tcp::Options::ReuseAddr);
opts.maxRequestSize(PISTACHE_SERVER_MAX_REQUEST_SIZE);
opts.maxResponseSize(PISTACHE_SERVER_MAX_RESPONSE_SIZE);
httpEndpoint->init(opts);
DefaultSolARImpl DefaultApiserver(router);
DefaultApiserver.init();
TrackablesSolARImpl TrackablesApiserver(router, worldStorage);
TrackablesApiserver.init();
WorldAnchorsSolARImpl WorldAnchorsApiserver(router, worldStorage);
WorldAnchorsApiserver.init();
WorldLinksSolARImpl WorldLinksApiserver(router, worldStorage);
WorldLinksApiserver.init();
httpEndpoint->setHandler(router->handler());
httpEndpoint->serve();
httpEndpoint->shutdown();
// init and start the World Graph Service
worldGraphService->init();
worldGraphService->start();
return EXIT_SUCCESS;
}
catch (xpcf::Exception e)
{
LOG_ERROR("Exception raised : \n {}", e.what())
LOG_ERROR("Exception raised : \n {}", e.what())
return -1;
}
return 0;
}
SolARFramework|1.3.0|SolARFramework|SolARBuild@github|https://github.com/SolarFramework/SolarFramework/releases/download
# This file is used to ignore files which are generated
# ----------------------------------------------------------------------------
*~
*.autosave
*.a
*.core
*.moc
*.o
*.obj
*.orig
*.rej
*.so
*.so.*
*_pch.h.cpp
*_resource.rc
*.qm
.#*
*.*#
core
!core/
tags
.DS_Store
.directory
*.debug
Makefile*
*.prl
*.app
moc_*.cpp
ui_*.h
qrc_*.cpp
Thumbs.db
*.res
*.rc
/.qmake.cache
/.qmake.stash
# qtcreator generated files
*.pro.user*
# xemacs temporary files
*.flc
# Vim temporary files
.*.swp
# Visual Studio generated files
*.ib_pdb_index
*.idb
*.ilk
*.pdb
*.sln
*.suo
*.vcproj
*vcproj.*.*.user
*.ncb
*.sdf
*.opensdf
*.vcxproj
*vcxproj.*
# MinGW generated files
*.Debug
*.Release
# Python byte code
*.pyc
# Binaries
# --------
*.dll
*.exe
## global defintions : target lib name, version
TARGET = SolARService_WorldStorage
VERSION = 0.11.0
QMAKE_PROJECT_DEPTH = 0
###############################################################################
# SolAR ARCloud
# (C) Copyright 2024 b<>com. All rights reserved.
#
# IDDN: FR.001.020021.000.S.C.2024.000.00000
# This software is the confidential intellectual property of b<>com.
# You shall not disclose it and shall use it only in accordance with
# the terms of the license agreement you entered into with b<>com.
#
################################################################################
## remove Qt dependencies
QT -= core gui
QT -= core gui
CONFIG -= qt
QMAKE_PROJECT_DEPTH = 0
## global defintions : target lib name, version
TARGET = SolARServiceTest_WorldStorage
VERSION=1.2.0
PROJECTDEPLOYDIR = $${PWD}/../../deploy
DEFINES += MYVERSION=$${VERSION}
CONFIG += c++1z
CONFIG += console
CONFIG += verbose
DEFINES += MYVERSION=$${VERSION}
CONFIG += externaldeps
include(findremakenrules.pri)
LIBS += -L"/usr/local" -l"PistacheGen"
CONFIG(debug,debug|release) {
DEFINES += _DEBUG=1
DEFINES += DEBUG=1
}
# Default rules for deployment.
qnx: target.path = $${PWD}/bin/Debug# /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
CONFIG(release,debug|release) {
DEFINES += _NDEBUG=1
DEFINES += NDEBUG=1
}
win32:CONFIG -= static
win32:CONFIG += shared
unix: CONFIG += link_pkgconfig
unix: PKGCONFIG += libpistache
QMAKE_TARGET.arch = x86_64 #must be defined prior to include
DEPENDENCIESCONFIG = sharedlib install_recurse
PROJECTCONFIG = QTVS
#NOTE : CONFIG as staticlib or sharedlib, DEPENDENCIESCONFIG as staticlib or sharedlib, QMAKE_TARGET.arch and PROJECTDEPLOYDIR MUST BE DEFINED BEFORE templatelibconfig.pri inclusion
include ($$shell_quote($$shell_path($${QMAKE_REMAKEN_RULES_ROOT}/templateappconfig.pri))) # Shell_quote & shell_path required for visual on windows
INCLUDEPATH += \
Solar-Wrapper/ \
Solar-Wrapper/interfaces/
HEADERS += \
Solar-Wrapper/interfaces/DefaultSolARImpl.h \
Solar-Wrapper/interfaces/TrackablesSolARImpl.h \
Solar-Wrapper/interfaces/UnitSysConversion.h \
Solar-Wrapper/interfaces/WorldAnchorsSolARImpl.h \
Solar-Wrapper/interfaces/WorldLinksSolARImpl.h
SOURCES += \
Solar-Wrapper/src/DefaultSolARImpl.cpp \
Solar-Wrapper/src/TrackablesSolARImpl.cpp \
Solar-Wrapper/src/WorldAnchorsSolARImpl.cpp \
Solar-Wrapper/src/WorldLinksSolARImpl.cpp \
Solar-Wrapper/src/main.cpp
SolARServiceTest_WorldStorage_main.cpp
DISTFILES += \
build/SolARSample_World_Storage_conf.xml \
packagedependencies.txt
unix {
LIBS += -ldl
QMAKE_CXXFLAGS += -Wno-attributes
# Avoids adding install steps manually. To be commented to have a better control over them.
QMAKE_POST_LINK += "$(MAKE) install install_deps"
}
linux {
QMAKE_LFLAGS += -ldl
# LIBS += -L/home/linuxbrew/.linuxbrew/lib # temporary fix caused by grpc with -lre2 ... without -L in grpc.pc
}
win32 {
config_files.path = target.path
config_files.files= $$files($${PWD}/SolARSample_World_Storage_conf.xml)
DEFINES += WIN64 UNICODE _UNICODE
QMAKE_COMPILER_DEFINES += _WIN64
QMAKE_CXXFLAGS += -wd4250 -wd4251 -wd4244 -wd4275
}
config_files.path = $${TARGETDEPLOYDIR}
config_files.files= $$files($${PWD}/SolARServiceTest_WorldStorage_conf.xml)
INSTALLS += config_files
OTHER_FILES += \
packagedependencies.txt
DISTFILES += \
.gitignore \
SolARServiceTest_WorldStorage_conf.xml
#NOTE : Must be placed at the end of the .pro
include ($$shell_quote($$shell_path($${QMAKE_REMAKEN_RULES_ROOT}/remaken_install_target.pri)))) # Shell_quote & shell_path required for visual on windows