GEOSX
GeometricObjectManager.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
7  * Copyright (c) 2018-2020 TotalEnergies
8  * Copyright (c) 2019- GEOSX Contributors
9  * All rights reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
19 #ifndef GEOS_MESH_SIMPLEGEOMETRICOBJECTS_GEOMETRICOBJECTMANAGER_HPP_
20 #define GEOS_MESH_SIMPLEGEOMETRICOBJECTS_GEOMETRICOBJECTMANAGER_HPP_
21 
22 #include "dataRepository/Group.hpp"
23 #include "mesh/simpleGeometricObjects/SimpleGeometricObjectBase.hpp"
24 
25 
26 namespace geos
27 {
28 
34 {
35 public:
36 
41 
47  GeometricObjectManager( string const & name,
48  Group * const parent );
49 
53  virtual ~GeometricObjectManager() override;
54 
56 
61 
62  virtual Group * createChild( string const & childKey, string const & childName ) override;
63 
72  template< typename OBJECTTYPE = SimpleGeometricObjectBase, typename ... OBJECTTYPES, typename LOOKUP_CONTAINER, typename LAMBDA >
73  void forGeometricObject( LOOKUP_CONTAINER const & targetObjects, LAMBDA && lambda )
74  {
75  this->forSubGroups< OBJECTTYPE, OBJECTTYPES... >( targetObjects, std::forward< LAMBDA >( lambda ) );
76  }
77 
78  virtual void expandObjectCatalogs() override;
79 
80 private:
81  GeometricObjectManager() = delete;
82  static GeometricObjectManager * m_instance;
83 
84 };
85 
86 } /* namespace geos */
87 
88 #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:508