aboutsummaryrefslogtreecommitdiff
path: root/lout
diff options
context:
space:
mode:
authorsgeerke <devnull@localhost>2012-06-24 12:06:15 +0200
committersgeerke <devnull@localhost>2012-06-24 12:06:15 +0200
commit39985d2c5158742fc9e00e7dd90559f9f5c8c75f (patch)
tree1950c633fd73c1b7ef5056ed18b9dcd527552d3b /lout
parente02ec1bd1405715f050a71d40a9e3c212dd43123 (diff)
First part of hyphenation! And some minor changes in "lout".
Diffstat (limited to 'lout')
-rw-r--r--lout/container.hh4
-rw-r--r--lout/identity.hh5
-rw-r--r--lout/misc.hh36
-rw-r--r--lout/object.hh4
-rw-r--r--lout/signal.hh4
5 files changed, 42 insertions, 11 deletions
diff --git a/lout/container.hh b/lout/container.hh
index 8a9e3e0f..d2484b13 100644
--- a/lout/container.hh
+++ b/lout/container.hh
@@ -3,6 +3,8 @@
#include "object.hh"
+namespace lout {
+
/**
* \brief This namespace contains a framework for container classes, which
* members are instances of object::Object.
@@ -15,8 +17,6 @@
*
* \sa container::untyped, container::typed
*/
-namespace lout {
-
namespace container {
/**
diff --git a/lout/identity.hh b/lout/identity.hh
index 6102933d..1f0b4bdf 100644
--- a/lout/identity.hh
+++ b/lout/identity.hh
@@ -5,12 +5,11 @@
#include "container.hh"
#include "signal.hh"
+namespace lout {
+
/**
* \brief Some stuff to identify classes of objects at run-time.
*/
-
-namespace lout {
-
namespace identity {
/**
diff --git a/lout/misc.hh b/lout/misc.hh
index 2a8584eb..05b87602 100644
--- a/lout/misc.hh
+++ b/lout/misc.hh
@@ -7,13 +7,13 @@
#include <string.h>
#include <assert.h>
+namespace lout {
+
/**
* \brief Miscellaneous stuff, which does not fit anywhere else.
*
* Actually, the other parts, beginning with ::object, depend on this.
*/
-namespace lout {
-
namespace misc {
template <class T> inline T min (T a, T b) { return a < b ? a : b; }
@@ -201,6 +201,38 @@ public:
}
/**
+ * \brief Return the reference of the first element (convenience method).
+ */
+ inline T* getFirstRef () {
+ assert (this->num > 0);
+ return this->array;
+ }
+
+ /**
+ * \brief Return the first element, explicitly.
+ */
+ inline T getFirst () {
+ assert (this->num > 0);
+ return this->array[0];
+ }
+
+ /**
+ * \brief Return the reference of the last element (convenience method).
+ */
+ inline T* getLastRef () {
+ assert (this->num > 0);
+ return this->array + this->num - 1;
+ }
+
+ /**
+ * \brief Return the last element, explicitly.
+ */
+ inline T getLast () {
+ assert (this->num > 0);
+ return this->array[this->num - 1];
+ }
+
+ /**
* \brief Store an object in the vector.
*
* Unlike in container::untyped::Vector and container::typed::Vector,
diff --git a/lout/object.hh b/lout/object.hh
index 789542fe..9df69987 100644
--- a/lout/object.hh
+++ b/lout/object.hh
@@ -6,12 +6,12 @@
#include "misc.hh"
+namespace lout {
+
/**
* \brief Here, some common classes (or interfaces) are defined, to standardize
* the access to other classes.
*/
-namespace lout {
-
namespace object {
/**
diff --git a/lout/signal.hh b/lout/signal.hh
index 6b332203..117779d6 100644
--- a/lout/signal.hh
+++ b/lout/signal.hh
@@ -4,6 +4,8 @@
#include "object.hh"
#include "container.hh"
+namespace lout {
+
/**
* \brief This namespace provides base classes to define signals.
*
@@ -174,8 +176,6 @@
* After this, &\em barReceiver can be connected to all instances of
* BarEmitter, also multiple times.
*/
-namespace lout {
-
namespace signal {
class Receiver;