Skip to content

Commit 65cc376

Browse files
author
Peter Thorson
committed
add docs for namespaces and concurrency policies
1 parent 10be5ee commit 65cc376

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

websocketpp/concurrency/none.hpp

+24-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, Peter Thorson. All rights reserved.
2+
* Copyright (c) 2014, Peter Thorson. All rights reserved.
33
*
44
* Redistribution and use in source and binary forms, with or without
55
* modification, are permitted provided that the following conditions are met:
@@ -29,26 +29,48 @@
2929
#define WEBSOCKETPP_CONCURRENCY_NONE_HPP
3030

3131
namespace websocketpp {
32+
33+
/// Concurrency handling support
3234
namespace concurrency {
3335

36+
/// Implementation for no-op locking primitives
3437
namespace none_impl {
38+
/// A fake mutex implementation that does nothing
3539
class fake_mutex {
3640
public:
3741
fake_mutex() {}
3842
~fake_mutex() {}
3943
};
4044

45+
/// A fake lock guard implementation that does nothing
4146
class fake_lock_guard {
4247
public:
4348
explicit fake_lock_guard(fake_mutex foo) {}
4449
~fake_lock_guard() {}
4550
};
4651
} // namespace none_impl
4752

48-
/// Stub Concurrency policy to remove locking in single threaded projects
53+
/// Stub concurrency policy that implements the interface using no-ops.
54+
/**
55+
* This policy documents the concurrency policy interface using no-ops. It can
56+
* be used as a reference or base for building a new concurrency policy. It can
57+
* also be used as is to disable all locking for endpoints used in purely single
58+
* threaded programs.
59+
*/
4960
class none {
5061
public:
62+
/// The type of a mutex primitive
63+
/**
64+
* std::mutex is an example.
65+
*/
5166
typedef none_impl::fake_mutex mutex_type;
67+
68+
/// The type of a scoped/RAII lock primitive.
69+
/**
70+
* The scoped lock constructor should take a mutex_type as a parameter,
71+
* acquire that lock, and release it in its destructor. std::lock_guard is
72+
* an example.
73+
*/
5274
typedef none_impl::fake_lock_guard scoped_lock_type;
5375
};
5476

websocketpp/http/constants.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <vector>
3434

3535
namespace websocketpp {
36+
/// HTTP handling support
3637
namespace http {
3738
/// The type of an HTTP attribute list
3839
/**

websocketpp/random/none.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#define WEBSOCKETPP_RANDOM_NONE_HPP
3030

3131
namespace websocketpp {
32+
/// Random number generation policies
3233
namespace random {
3334
/// Stub RNG policy that always returns 0
3435
namespace none {

0 commit comments

Comments
 (0)