]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Mark a few Subscriptor functions as inline. 7652/head
authorDavid Wells <drwells@email.unc.edu>
Mon, 28 Jan 2019 21:51:31 +0000 (16:51 -0500)
committerDavid Wells <drwells@email.unc.edu>
Mon, 28 Jan 2019 21:52:42 +0000 (16:52 -0500)
These are simple enough that they should live in the header. This will
allow classes inheriting from Subscriptor to potentially inline some
more constructors too.

include/deal.II/base/subscriptor.h
source/base/subscriptor.cc

index f59d18283973ad773eda51a840be7e50577c5cfb..431f8c03e4126940855d5b07fba4d257a599afa7 100644 (file)
@@ -290,6 +290,37 @@ private:
 
 //---------------------------------------------------------------------------
 
+inline Subscriptor::Subscriptor()
+  : counter(0)
+  , object_info(nullptr)
+{}
+
+
+
+inline Subscriptor::Subscriptor(const Subscriptor &)
+  : counter(0)
+  , object_info(nullptr)
+{}
+
+
+
+inline Subscriptor &
+Subscriptor::operator=(const Subscriptor &s)
+{
+  object_info = s.object_info;
+  return *this;
+}
+
+
+
+inline unsigned int
+Subscriptor::n_subscriptions() const
+{
+  return counter;
+}
+
+
+
 template <class Archive>
 inline void
 Subscriptor::serialize(Archive &, const unsigned int)
index aeac2c0807dd2ae42c07dcc966b8e3ea15eb85b2..669f71b9092b8b03336b6dc26a7a89efff46b1f8 100644 (file)
@@ -31,23 +31,6 @@ static const char *unknown_subscriber = "unknown subscriber";
 std::mutex Subscriptor::mutex;
 
 
-Subscriptor::Subscriptor()
-  : counter(0)
-  , object_info(nullptr)
-{
-  // this has to go somewhere to avoid an extra warning.
-  (void)unknown_subscriber;
-}
-
-
-
-Subscriptor::Subscriptor(const Subscriptor &)
-  : counter(0)
-  , object_info(nullptr)
-{}
-
-
-
 Subscriptor::Subscriptor(Subscriptor &&subscriptor) noexcept
   : counter(0)
   , object_info(subscriptor.object_info)
@@ -132,15 +115,6 @@ Subscriptor::check_no_subscribers() const noexcept
 
 
 
-Subscriptor &
-Subscriptor::operator=(const Subscriptor &s)
-{
-  object_info = s.object_info;
-  return *this;
-}
-
-
-
 Subscriptor &
 Subscriptor::operator=(Subscriptor &&s) noexcept
 {
@@ -224,14 +198,6 @@ Subscriptor::unsubscribe(std::atomic<bool> *const validity,
 
 
 
-unsigned int
-Subscriptor::n_subscriptions() const
-{
-  return counter;
-}
-
-
-
 void
 Subscriptor::list_subscribers() const
 {

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.