Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Nov 4, 2024
1 parent a633d33 commit 92f8918
Show file tree
Hide file tree
Showing 14 changed files with 345 additions and 45 deletions.
20 changes: 16 additions & 4 deletions doc/hash2/reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,25 @@ include::reference/ripemd.adoc[]

## Utilities and Traits

### <boost/hash2/endian.hpp>
:leveloffset: +2

### <boost/hash2/is_contiguously_hashable.hpp>
include::reference/digest.adoc[]
include::reference/endian.adoc[]
include::reference/flavor.adoc[]
include::reference/get_integral_result.adoc[]
include::reference/is_trivially_equality_comparable.adoc[]
include::reference/is_endian_independent.adoc[]
include::reference/is_contiguously_hashable.adoc[]
include::reference/has_constant_size.adoc[]

### <boost/hash2/get_integral_result.hpp>
:leveloffset: -2

## hash_append

### <boost/hash2/hash_append.hpp>
:leveloffset: +2

include::reference/hash_append_fwd.adoc[]
include::reference/hash_append.adoc[]

:leveloffset: -2

22 changes: 22 additions & 0 deletions doc/hash2/reference/digest.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
////
Copyright 2024 Peter Dimov
Distributed under the Boost Software License, Version 1.0.
https://www.boost.org/LICENSE_1_0.txt
////

[#ref_digest]
# <boost/hash2/digest.hpp>
:idprefix: ref_digest_

```
namespace boost {
namespace hash2 {

class digest;

} // namespace hash2
} // namespace boost
```

## digest

22 changes: 22 additions & 0 deletions doc/hash2/reference/endian.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
////
Copyright 2024 Peter Dimov
Distributed under the Boost Software License, Version 1.0.
https://www.boost.org/LICENSE_1_0.txt
////

[#ref_endian]
# <boost/hash2/endian.hpp>
:idprefix: ref_endian_

```
namespace boost {
namespace hash2 {

enum class endian;

} // namespace hash2
} // namespace boost
```

## endian

30 changes: 30 additions & 0 deletions doc/hash2/reference/flavor.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
////
Copyright 2024 Peter Dimov
Distributed under the Boost Software License, Version 1.0.
https://www.boost.org/LICENSE_1_0.txt
////

[#ref_flavor]
# <boost/hash2/flavor.hpp>
:idprefix: ref_flavor_

```
#include <boost/hash2/endian.hpp>

namespace boost {
namespace hash2 {

struct default_flavor;
struct little_endian_flavor;
struct big_endian_flavor;

} // namespace hash2
} // namespace boost
```

## default_flavor

## little_endian_flavor

## big_endian_flavor

44 changes: 24 additions & 20 deletions doc/hash2/reference/fnv1a.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,21 @@ public:

using result_type = std::uint32_t;

fnv1a_32();
explicit fnv1a_32( std::uint64_t seed );
fnv1a_32( unsigned char const* p, std::size_t n );
constexpr fnv1a_32();
explicit constexpr fnv1a_32( std::uint64_t seed );
constexpr fnv1a_32( unsigned char const* p, std::size_t n );

void update( void const * p, std::size_t n );
void update( void const* p, std::size_t n );
constexpr void update( unsigned char const* p, std::size_t n );

result_type result();
constexpr result_type result();
};
```

### Constructors

```
fnv1a_32();
constexpr fnv1a_32();
```

Default constructor.
Expand All @@ -56,7 +57,7 @@ Effects: ::
Initializes `state_` to `0x811c9dc5`.

```
explicit fnv1a_32( std::uint64_t seed );
explicit constexpr fnv1a_32( std::uint64_t seed );
```

Constructor taking an integral seed value.
Expand All @@ -68,7 +69,7 @@ Remarks: ::
By convention, if `seed` is zero, the effect of this constructor is the same as default construction.

```
fnv1a_32( unsigned char const* p, std::size_t n );
constexpr fnv1a_32( unsigned char const* p, std::size_t n );
```

Constructor taking a byte sequence seed.
Expand All @@ -82,7 +83,8 @@ Remarks: ::
### update

```
void update( void const * p, std::size_t n );
void update( void const* p, std::size_t n );
constexpr void update( unsigned char const* p, std::size_t n );
```

Effects: ::
Expand All @@ -91,7 +93,7 @@ Effects: ::
### result

```
result_type result();
constexpr result_type result();
```

Effects: ::
Expand All @@ -118,20 +120,21 @@ public:

using result_type = std::uint64_t;

fnv1a_64();
explicit fnv1a_64( std::uint64_t seed );
fnv1a_64( unsigned char const* p, std::size_t n );
constexpr fnv1a_64();
explicit constexpr fnv1a_64( std::uint64_t seed );
constexpr fnv1a_64( unsigned char const* p, std::size_t n );

void update( void const * p, std::size_t n );
void update( void const* p, std::size_t n );
constexpr void update( unsigned char const* p, std::size_t n );

result_type result();
constexpr result_type result();
};
```

### Constructors

```
fnv1a_64();
constexpr fnv1a_64();
```

Default constructor.
Expand All @@ -140,7 +143,7 @@ Effects: ::
Initializes `state_` to `0xcbf29ce484222325`.

```
explicit fnv1a_64( std::uint64_t seed );
explicit constexpr fnv1a_64( std::uint64_t seed );
```

Constructor taking an integral seed value.
Expand All @@ -152,7 +155,7 @@ Remarks: ::
By convention, if `seed` is zero, the effect of this constructor is the same as default construction.

```
fnv1a_64( unsigned char const* p, std::size_t n );
constexpr fnv1a_64( unsigned char const* p, std::size_t n );
```

Constructor taking a byte sequence seed.
Expand All @@ -166,7 +169,8 @@ Remarks: ::
### update

```
void update( void const * p, std::size_t n );
void update( void const* p, std::size_t n );
constexpr void update( unsigned char const* p, std::size_t n );
```

Effects: ::
Expand All @@ -175,7 +179,7 @@ Effects: ::
### result

```
result_type result();
constexpr result_type result();
```

Effects: ::
Expand Down
26 changes: 26 additions & 0 deletions doc/hash2/reference/get_integral_result.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
////
Copyright 2024 Peter Dimov
Distributed under the Boost Software License, Version 1.0.
https://www.boost.org/LICENSE_1_0.txt
////

[#ref_get_integral_result]
# <boost/hash2/get_integral_result.hpp>
:idprefix: ref_get_integral_result_

```
namespace boost {
namespace hash2 {

template<class T, class R> constexpr T get_integral_result( R const& r );

} // namespace hash2
} // namespace boost
```

## get_integral_result

```
template<class T, class R> constexpr T get_integral_result( R const& r );
```

22 changes: 22 additions & 0 deletions doc/hash2/reference/has_constant_size.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
////
Copyright 2024 Peter Dimov
Distributed under the Boost Software License, Version 1.0.
https://www.boost.org/LICENSE_1_0.txt
////

[#ref_has_constant_size]
# <boost/hash2/has_constant_size.hpp>
:idprefix: ref_has_constant_size_

```
namespace boost {
namespace hash2 {

template<class T> struct has_constant_size;

} // namespace hash2
} // namespace boost
```

## has_constant_size

49 changes: 49 additions & 0 deletions doc/hash2/reference/hash_append.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
////
Copyright 2024 Peter Dimov
Distributed under the Boost Software License, Version 1.0.
https://www.boost.org/LICENSE_1_0.txt
////

[#ref_hash_append]
# <boost/hash2/hash_append.hpp>
:idprefix: ref_hash_append_

```
#include <boost/hash2/flavor.hpp>

namespace boost {
namespace hash2 {

template<class Hash, class Flavor = default_flavor, class T>
constexpr void hash_append( Hash& h, Flavor const& f, T const& v );

template<class Hash, class Flavor = default_flavor, class It>
constexpr void hash_append_range( Hash& h, Flavor const& f, It first, It last );

template<class Hash, class Flavor = default_flavor, class T>
constexpr void hash_append_size( Hash& h, Flavor const& f, T const& v );

template<class Hash, class Flavor = default_flavor, class It>
constexpr void hash_append_sized_range( Hash& h, Flavor const& f, It first, It last );

template<class Hash, class Flavor = default_flavor, class It>
constexpr void hash_append_unordered_range( Hash& h, Flavor const& f, It first, It last );

struct hash_append_tag;

} // namespace hash2
} // namespace boost
```

## hash_append

## hash_append_range

## hash_append_size

## hash_append_sized_range

## hash_append_unordered_range

## hash_append_tag

37 changes: 37 additions & 0 deletions doc/hash2/reference/hash_append_fwd.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
////
Copyright 2024 Peter Dimov
Distributed under the Boost Software License, Version 1.0.
https://www.boost.org/LICENSE_1_0.txt
////

[#ref_hash_append_fwd]
# <boost/hash2/hash_append_fwd.hpp>
:idprefix: ref_hash_append_fwd_

## Synopsis

```
namespace boost {
namespace hash2 {

template<class Hash, class Flavor, class T>
constexpr void hash_append( Hash& h, Flavor const& f, T const& v );

template<class Hash, class Flavor, class It>
constexpr void hash_append_range( Hash& h, Flavor const& f, It first, It last );

template<class Hash, class Flavor, class T>
constexpr void hash_append_size( Hash& h, Flavor const& f, T const& v );

template<class Hash, class Flavor, class It>
constexpr void hash_append_sized_range( Hash& h, Flavor const& f, It first, It last );

template<class Hash, class Flavor, class It>
constexpr void hash_append_unordered_range( Hash& h, Flavor const& f, It first, It last );

struct hash_append_tag;

} // namespace hash2
} // namespace boost
```

Loading

0 comments on commit 92f8918

Please sign in to comment.