From: g0dil Date: Wed, 7 May 2008 13:41:44 +0000 (+0000) Subject: Console: Documentation fix X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=1863c038d0400159ce49b851a5b81c2ce698c684;p=senf.git Console: Documentation fix git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@836 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Console/Example.dox b/Console/Example.dox index bb39190..c571c36 100644 --- a/Console/Example.dox +++ b/Console/Example.dox @@ -82,24 +82,25 @@ \until settings - This shows, how to set the top-level documentation and create a new subdirectory directly + This shows, how to set the top-level documentation and create a new subdirectory. - \until mkdir + \until doc - Here we create another new directory but save a reference so we can later access the node + Here we create another new directory and save a reference so we can later access the node directly. All the add commands return such a node reference of the correct type (this is a lie, but it works like this anyways and it's an implementation detail that must not concern you here). - This way of stroing a refernce is not bad, but even better is to use a \c - senf::console::ScopedDirectory<> for this + Instead of creating a new directory directly and later sotring a reference, it is better to use + \c senf::console::ScopedDirectory<> like this: \until functions - This will automatically remove the node from the tree when the senf::console::ScopedDiretory - instance is destroyed and keeps the node alive even when unlinked from the tree (a plain - reference becomes invalid when anyone later unlinks the node from the tree). This is much safer - and is the preferred way to keep a hold on a directory. + This will automatically remove the node from the tree when the \c senf::console::ScopedDirectory + instance is destroyed. It also protects against the problem of dangling references: When using a + plain reference, removing the directory from the tree will destroy the node. The reference + however will still reference the (now nonexistent) directory and any access via the reference + will crash the program. The next statements add commands to the various directories declared so far diff --git a/Console/testServer.cc b/Console/testServer.cc index 429d959..e8123e2 100644 --- a/Console/testServer.cc +++ b/Console/testServer.cc @@ -113,7 +113,7 @@ int main(int, char **) .add("testob", test.dir) .doc("Example of an instance directory"); - senf::console::Server::start( senf::INet4SocketAddress(23232) ) + senf::console::Server::start( senf::INet4SocketAddress(23232u) ) .name("testServer"); senf::Scheduler::instance().process();