GEOS
GeometricObjectManager.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2024 Total, S.A
7  * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
8  * Copyright (c) 2023-2024 Chevron
9  * Copyright (c) 2019- GEOS/GEOSX Contributors
10  * All rights reserved
11  *
12  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
13  * ------------------------------------------------------------------------------------------------------------
14  */
15 
20 #ifndef GEOS_MESH_SIMPLEGEOMETRICOBJECTS_GEOMETRICOBJECTMANAGER_HPP_
21 #define GEOS_MESH_SIMPLEGEOMETRICOBJECTS_GEOMETRICOBJECTMANAGER_HPP_
22 
23 #include "dataRepository/Group.hpp"
24 #include "mesh/simpleGeometricObjects/SimpleGeometricObjectBase.hpp"
25 
26 
27 namespace geos
28 {
29 
35 {
36 public:
37 
42 
48  GeometricObjectManager( string const & name,
49  Group * const parent );
50 
54  virtual ~GeometricObjectManager() override;
55 
57 
62 
63  virtual Group * createChild( string const & childKey, string const & childName ) override;
64 
73  template< typename OBJECTTYPE = SimpleGeometricObjectBase, typename ... OBJECTTYPES, typename LOOKUP_CONTAINER, typename LAMBDA >
74  void forGeometricObject( LOOKUP_CONTAINER const & targetObjects, LAMBDA && lambda )
75  {
76  this->forSubGroups< OBJECTTYPE, OBJECTTYPES... >( targetObjects, std::forward< LAMBDA >( lambda ) );
77  }
78 
79  virtual void expandObjectCatalogs() override;
80 
81 private:
82  GeometricObjectManager() = delete;
83  static GeometricObjectManager * m_instance;
84 
85 };
86 
87 } /* namespace geos */
88 
89 #endif /* GEOS_MESH_SIMPLEGEOMETRICOBJECTS_GEOMETRICOBJECTMANAGER_HPP_ */
Manager of the simple geometric objects.
virtual ~GeometricObjectManager() override
Default destructor.
virtual void expandObjectCatalogs() override
Expand any catalogs in the data structure.
virtual Group * createChild(string const &childKey, string const &childName) override
Creates a new sub-Group using the ObjectCatalog functionality.
static GeometricObjectManager & getInstance()
GeometricObjectManager(string const &name, Group *const parent)
Constructor.
void forGeometricObject(LOOKUP_CONTAINER const &targetObjects, LAMBDA &&lambda)
This function is used to launch a unction over the target geometric objects with region type = Simple...
Base class for the geometric objects (box, plane, cylinder).
void forSubGroups(LAMBDA &&lambda)
Apply the given functor to subgroups that can be casted to one of specified types.
Definition: Group.hpp:518