Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
AbstractService.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* AbstractService.h (C) 2000-2025 */
9/* */
10/* Base class of a service. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_ABSTRACTSERVICE_H
13#define ARCANE_CORE_ABSTRACTSERVICE_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/TraceAccessor.h"
18
20#include "arcane/core/IService.h"
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
25namespace Arcane
26{
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
38class ARCANE_CORE_EXPORT AbstractService
39: public TraceAccessor
40, public IService
41{
42 protected:
43
45 explicit AbstractService(const ServiceBuildInfo&);
46
47 public:
48
50 ~AbstractService() override;
51
52 public:
53
59 virtual void build() {}
60
61 public:
62
64 IServiceInfo* serviceInfo() const override { return m_service_info; }
65
67 IBase* serviceParent() const override { return m_parent; }
68
70 IService* serviceInterface() override { return this; }
71
72 private:
73
74 IServiceInfo* m_service_info = nullptr;
75 IBase* m_parent = nullptr;
76};
77
78/*---------------------------------------------------------------------------*/
79/*---------------------------------------------------------------------------*/
80
81} // namespace Arcane
82
83/*---------------------------------------------------------------------------*/
84/*---------------------------------------------------------------------------*/
85
86#endif
Declarations of Arcane's general types.
IService * serviceInterface() override
Returns the low-level IService interface of the service.
IServiceInfo * serviceInfo() const override
Access to service information. See IServiceInfo for details.
AbstractService(const ServiceBuildInfo &)
Constructor from a ServiceBuildInfo.
IBase * serviceParent() const override
Access to the base interface of main Arcane objects.
virtual void build()
Build-level construction of the service.
Interface of the base class for main arcane objects.
Definition IBase.h:32
Interface for service or module information.
IService()
Constructor.
Definition IService.h:44
Structure containing the information to create a service.
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --