Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
senf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wiback
senf
Commits
0313acf3
Commit
0313acf3
authored
17 years ago
by
g0dil
Browse files
Options
Downloads
Patches
Plain Diff
Utils: Fix documentation
parent
cf33f7b0
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Utils/Exception.hh
+40
-4
40 additions, 4 deletions
Utils/Exception.hh
Utils/Mainpage.dox
+1
-3
1 addition, 3 deletions
Utils/Mainpage.dox
Utils/auto_unit_test.hh
+2
-2
2 additions, 2 deletions
Utils/auto_unit_test.hh
Utils/mpl.hh
+2
-2
2 additions, 2 deletions
Utils/mpl.hh
with
45 additions
and
11 deletions
Utils/Exception.hh
+
40
−
4
View file @
0313acf3
...
@@ -35,6 +35,40 @@
...
@@ -35,6 +35,40 @@
//#include "Exception.mpp"
//#include "Exception.mpp"
///////////////////////////////hh.p////////////////////////////////////////
///////////////////////////////hh.p////////////////////////////////////////
/** \defgroup exception System exceptions
The senf::SystemException class and it's derived class template senf::ErrnoException are used to
signal generic system failures based on \c errno codes.
senf::SystemException is a generic \c errno based exception which carries an error number and
origin information. senf::ErrnoException is a derived class specialized for a specific error
code. This simplifies managing error conditions:
\code
try {
something.open(path);
// ...
}
catch (senf::ErrnoException<ENOFILE> & e) {
// Create new file
}
catch (senf::SystemException & e) {
// Catch all other system exceptions
std::cerr << "Error accessing '" << path << "': " << e.what() << std::endl;
}
\endcode
This exception is normally thrown using the senf::throwErrno() helper:
\code
if ((fd = ::open(path.c_str(), O_RDWR)) < 0)
senf::throwErrno("::open()");
\endcode
The senf::throwErrno() helper will throw the correct exception class based on some \c errno
value.
*/
namespace
senf
{
namespace
senf
{
/** \brief Exception handling standard UNIX errors (errno)
/** \brief Exception handling standard UNIX errors (errno)
...
@@ -47,6 +81,7 @@ namespace senf {
...
@@ -47,6 +81,7 @@ namespace senf {
be thrown via one of the senf::throwErrno() helpers.
be thrown via one of the senf::throwErrno() helpers.
\see ErrnoException
\see ErrnoException
\ingroup exception
*/
*/
class
SystemException
:
public
std
::
exception
class
SystemException
:
public
std
::
exception
{
{
...
@@ -100,6 +135,7 @@ namespace senf {
...
@@ -100,6 +135,7 @@ namespace senf {
if ((fd = ::open(filename, O_RDWR)) < 0)
if ((fd = ::open(filename, O_RDWR)) < 0)
senf::throwErrno("open()");
senf::throwErrno("open()");
\endcode
\endcode
\ingroup exception
*/
*/
template
<
int
Code
>
template
<
int
Code
>
class
ErrnoException
:
public
SystemException
class
ErrnoException
:
public
SystemException
...
@@ -114,22 +150,22 @@ namespace senf {
...
@@ -114,22 +150,22 @@ namespace senf {
/** \brief Throw ErrnoException based on current \c errno value
/** \brief Throw ErrnoException based on current \c errno value
\
related ErrnoE
xception
\
ingroup e
xception
*/
*/
void
throwErrno
();
void
throwErrno
();
/** \brief Throw ErrnoException based on current \c errno value (with location info)
/** \brief Throw ErrnoException based on current \c errno value (with location info)
\
related ErrnoE
xception
\
ingroup e
xception
*/
*/
void
throwErrno
(
char
const
*
where
);
void
throwErrno
(
char
const
*
where
);
/** \brief Throw ErrnoException based on given \c errno value
/** \brief Throw ErrnoException based on given \c errno value
\
related ErrnoE
xception
\
ingroup e
xception
*/
*/
void
throwErrno
(
int
code
);
void
throwErrno
(
int
code
);
/** \brief Throw ErrnoException based on given \c errno value (with location info)
/** \brief Throw ErrnoException based on given \c errno value (with location info)
\
related ErrnoE
xception
\
ingroup e
xception
*/
*/
void
throwErrno
(
char
const
*
where
,
int
code
);
void
throwErrno
(
char
const
*
where
,
int
code
);
...
...
This diff is collapsed.
Click to expand it.
Utils/Mainpage.dox
+
1
−
3
View file @
0313acf3
...
@@ -58,9 +58,7 @@ namespace senf {
...
@@ -58,9 +58,7 @@ namespace senf {
\section miscstuff Miscellaneous
\section miscstuff Miscellaneous
<table class="listing">
<table class="listing">
<tr><td>\ref SystemException</td><td>standard exception for system errors (errno)</td></tr>
<tr><td>\ref exception</td><td>standard exception for system errors (errno)</td></tr>
<tr><td>\ref process</td><td>Some simple process management and daemon helpers</td></tr>
<tr><td>\ref hexdump</td><td>a simple but usefull function to write binary data in in
<tr><td>\ref hexdump</td><td>a simple but usefull function to write binary data in in
hexadecimal format.</td></tr>
hexadecimal format.</td></tr>
...
...
This diff is collapsed.
Click to expand it.
Utils/auto_unit_test.hh
+
2
−
2
View file @
0313acf3
...
@@ -27,8 +27,8 @@
...
@@ -27,8 +27,8 @@
unit tests. If the available Boost version is 1.34, this file will automatically take care of
unit tests. If the available Boost version is 1.34, this file will automatically take care of
any necessary workarounds.
any necessary workarounds.
So, instead of <tt>#include <boost/test/auto_unit_test.hpp></tt>, you should always write
So, instead of <tt>
\
#include <boost/test/auto_unit_test.hpp></tt>, you should always write
<tt>#include "../Utils/auto_unit_test.hh"<tt> (with possibliy adjusted path).
<tt>
\
#include "../Utils/auto_unit_test.hh"<tt> (with possibliy adjusted path).
*/
*/
#ifndef HH_auto_unit_test_
#ifndef HH_auto_unit_test_
...
...
This diff is collapsed.
Click to expand it.
Utils/mpl.hh
+
2
−
2
View file @
0313acf3
...
@@ -105,8 +105,8 @@ namespace mpl {
...
@@ -105,8 +105,8 @@ namespace mpl {
never called.
never called.
This number is than forwarded as template argument to \c select which is specialized for
This number is than forwarded as template argument to \c select which is specialized for
each case. Therefore, <tt>choice<A></tt> has a \c frobble() member whereas
each case. Therefore, <tt>choice
\
<A
\
></tt> has a \c frobble() member whereas
<tt>choice<B></tt> has a \c dazzle() member.
<tt>choice
\
<B
\
></tt> has a \c dazzle() member.
\see \ref SENF_MPL_RV
\see \ref SENF_MPL_RV
\ingroup senfmpl
\ingroup senfmpl
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment