Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Concatenate nested namespaces (sonar).
[simgrid.git] / src / kernel / context / Context.hpp
index b0c22c2..c8aba56 100644 (file)
@@ -14,9 +14,7 @@
 #include <csignal>
 #include <functional>
 
-namespace simgrid {
-namespace kernel {
-namespace context {
+namespace simgrid::kernel::context {
 extern unsigned stack_size;
 extern unsigned guard_size;
 
@@ -35,6 +33,9 @@ public:
 
   virtual void run_all(std::vector<actor::ActorImpl*> const& actors_list) = 0;
 
+  /* This allows Java to hijack the context factory (Java induces factories of factory :) */
+  static std::function<ContextFactory*(void)> initializer;
+
 protected:
   template <class T, class... Args> T* new_context(Args&&... args)
   {
@@ -97,11 +98,6 @@ public:
   virtual void attach_stop() = 0;
 };
 
-
-/* This allows Java to hijack the context factory (Java induces factories of factory :) */
-using ContextFactoryInitializer = ContextFactory* (*)();
-XBT_PUBLIC_DATA ContextFactoryInitializer factory_initializer;
-
 XBT_PRIVATE ContextFactory* thread_factory();
 XBT_PRIVATE ContextFactory* sysv_factory();
 XBT_PRIVATE ContextFactory* raw_factory();
@@ -112,8 +108,6 @@ XBT_PUBLIC int get_nthreads();
 XBT_PUBLIC void set_nthreads(int nb_threads);
 XBT_PUBLIC void set_parallel_mode(e_xbt_parmap_mode_t mode);
 XBT_PUBLIC e_xbt_parmap_mode_t get_parallel_mode();
-} // namespace context
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::context
 
 #endif