Skip to content

Commit 5a67fe8

Browse files
committed
adding doxygen styled comments ..
1 parent cd43197 commit 5a67fe8

25 files changed

Lines changed: 555 additions & 120 deletions

source/hashcc/hashcc.h

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
22
* @file hashcc.h
3+
* @brief Main include file for HASHCC library
34
* @author Christian (graetz23@gmail.com)
45
*
56
* HASHCC is distributed under the MIT License (MIT); this file is part of.
@@ -23,6 +24,21 @@
2324
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2425
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2526
* THE SOFTWARE.
27+
*
28+
* @defgroup HASHCC HASHCC Library
29+
* @brief Template-based C++ Hash Map Library
30+
*
31+
* HASHCC is an object-oriented C++ hash map library based on C++ templates.
32+
* It implements a trie-like hash tree data structure, providing efficient
33+
* key-value storage with customizable hash functions.
34+
*
35+
* @li @ref Types - Core type definitions
36+
* @li @ref STC - Static character tables
37+
* @li @ref TYP - Type system and tree structures
38+
* @li @ref ERR - Error handling
39+
* @li @ref FNC - Hash functions
40+
* @li @ref DMY - Dummy/placeholder objects
41+
* @li @ref OBJ - Hash map objects
2642
*/
2743

2844
#ifndef __hashcc_h__
@@ -42,16 +58,21 @@
4258

4359
namespace HASHCC {
4460

45-
/// use and share by the MIT License (MIT)
61+
/** @brief License identifier */
4662
#define _HASHCC_LICENSE_ "MIT"
4763

48-
/// from http://www.kleimo.com/random/name.cfm female, 1, 99
49-
// Pauletta Freshley 20090926 0.00
50-
// Deeaan Lampel 20160106 0.10
51-
#define _HASHCC_PACKAGE_ "Agnes Newton" // since 20200307
64+
/**
65+
* @brief Package name
66+
* @details From http://www.kleimo.com/random/name.cfm female, 1, 99
67+
* - Pauletta Freshley 20090926 0.00
68+
* - Deeaan Lampel 20160106 0.10
69+
*/
70+
#define _HASHCC_PACKAGE_ "Agnes Newton"
5271

53-
/// first load test are done for prototype of binary hash function and tree
72+
/** @brief Version number */
5473
#define _HASHCC_VERSION_NO_ "0.20"
74+
75+
/** @brief Version date (YYYYMMDD) */
5576
#define _HASHCC_VERSION_DATE_ 20200307
5677

5778
} // namespace HASHCC

source/hashcc/hashccDmy.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
22
* @file hashccDmy.h
3+
* @brief Dummy/placeholder namespace and object includes
34
* @author Christian (graetz23@gmail.com)
45
*
56
* HASHCC is distributed under the MIT License (MIT); this file is part of.
@@ -23,6 +24,12 @@
2324
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2425
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2526
* THE SOFTWARE.
27+
*
28+
* @defgroup DMY Dummy Objects
29+
* @brief Dummy/placeholder namespace for testing and development.
30+
*
31+
* The DMY namespace provides dummy/placeholder objects used for
32+
* testing and development purposes.
2633
*/
2734

2835
#ifndef __hashccDmy_h__

source/hashcc/hashccDmyObject.h

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
22
* @file hashccDmyObject.h
3+
* @brief Dummy object class for testing
34
* @author Christian (graetz23@gmail.com)
45
*
56
* HASHCC is distributed under the MIT License (MIT); this file is part of.
@@ -23,6 +24,12 @@
2324
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2425
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2526
* THE SOFTWARE.
27+
*
28+
* @class HASHCC::DMY::Object
29+
* @brief Dummy object class for testing.
30+
* @ingroup DMY
31+
*
32+
* A simple placeholder used object class for testing the hash map.
2633
*/
2734

2835
#ifndef __hashccDmyObject_h__
@@ -46,18 +53,28 @@ namespace DMY {
4653

4754
typedef HASHCC::String String; // namespace typedef
4855

49-
class /// class as pattern for following classes
50-
Object {
56+
/**
57+
* @class HASHCC::DMY::Object
58+
* @brief Dummy object class for testing.
59+
* @ingroup DMY
60+
*/
61+
class Object {
5162
public:
5263

53-
Object( void ); /// constructor
54-
Object( String string ); /// constructor
55-
virtual ~Object( void ); /// destructor
64+
/** @brief Default constructor */
65+
Object( void );
66+
/** @brief Construct with string */
67+
Object( String string );
68+
/** @brief Destructor */
69+
virtual ~Object( void );
5670

57-
String getString( void ); /// returns stored string
58-
void setString( String string ); /// stores a string
71+
/** @brief Returns stored string */
72+
String getString( void );
73+
/** @brief Stores a string */
74+
void setString( String string );
5975

60-
friend std::ostream& operator << ( std::ostream& s, Object& o ); /// std::cout
76+
/** @brief Stream output operator */
77+
friend std::ostream& operator << ( std::ostream& s, Object& o );
6178
friend std::ostream& operator << ( std::ostream& s, Object* o ); /// std::cout
6279

6380
protected:

source/hashcc/hashccErr.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
22
* @file hashccErr.h
3+
* @brief Error handling namespace and includes
34
* @author Christian (graetz23@gmail.com)
45
*
56
* HASHCC is distributed under the MIT License (MIT); this file is part of.
@@ -23,6 +24,16 @@
2324
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2425
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2526
* THE SOFTWARE.
27+
*
28+
* @defgroup ERR Error Handling
29+
* @brief Exception classes for error handling in HASHCC.
30+
*
31+
* The ERR namespace provides exception classes for handling recoverable
32+
* and non-recoverable errors in the HASHCC library.
33+
*
34+
* @li @ref ERR::Exception - Base exception class
35+
* @li @ref ERR::Failure - Recoverable exceptions
36+
* @li @ref ERR::Error - Non-recoverable errors
2637
*/
2738
#ifndef __hashccErr_h__
2839
#define __hashccErr_h__

source/hashcc/hashccErrError.h

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
22
* @file hashccErrError.h
3+
* @brief Non-recoverable error exception class
34
* @author Christian (graetz23@gmail.com)
45
*
56
* HASHCC is distributed under the MIT License (MIT); this file is part of.
@@ -23,6 +24,13 @@
2324
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2425
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2526
* THE SOFTWARE.
27+
*
28+
* @class HASHCC::ERR::Error
29+
* @brief Non-recoverable error exception.
30+
* @ingroup ERR
31+
*
32+
* This exception class represents non-recoverable errors that should
33+
* cause the program to terminate. It inherits from Exception.
2634
*/
2735

2836
#ifndef __hashccErrError_h__
@@ -44,22 +52,39 @@ namespace ERR {
4452

4553
/******************************************************************************/
4654

55+
/**
56+
* @class HASHCC::ERR::Error
57+
* @brief Non-recoverable error exception.
58+
* @ingroup ERR
59+
*
60+
* This exception class represents non-recoverable errors that should
61+
* cause the program to terminate. It inherits from Exception.
62+
*/
4763
class /// class for marking a non recoverable error
4864
Error : public Exception { // for real errors
4965
public:
5066

51-
Error( void ); /// constructor
52-
Error( std::exception e ); /// constructor
53-
Error( cChar* message ); /// constructor overloaded
54-
Error( String message ); /// constructor overloaded
55-
Error( String message, Int16 lineNo ); /// use __LINE__ @ lineNo
56-
Error( String message, Char* fileName ); /// use __FILE__ @ fileName
57-
Error( String message, Char* fileName, Int16 lineNo ); /// use __FILE__ @ fileName and __LINE__ @ lineNo
58-
virtual ~Error( void ); /// destructor
67+
/** @brief Default constructor */
68+
Error( void );
69+
/** @brief Construct from std::exception */
70+
Error( std::exception e );
71+
/** @brief Construct with C-string message */
72+
Error( cChar* message );
73+
/** @brief Construct with String message */
74+
Error( String message );
75+
/** @brief Construct with message and line number */
76+
Error( String message, Int16 lineNo );
77+
/** @brief Construct with message and filename */
78+
Error( String message, Char* fileName );
79+
/** @brief Construct with message, filename and line number */
80+
Error( String message, Char* fileName, Int16 lineNo );
81+
/** @brief Destructor */
82+
virtual ~Error( void );
5983

6084
protected:
6185

62-
virtual void mark( void ); /// mark an exception
86+
/** @brief Marks the exception */
87+
virtual void mark( void );
6388

6489
}; // class Error
6590

source/hashcc/hashccErrException.h

Lines changed: 60 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
22
* @file hashccErrException.h
3+
* @brief Base exception class for HASHCC
34
* @author Christian (graetz23@gmail.com)
45
*
56
* HASHCC is distributed under the MIT License (MIT); this file is part of.
@@ -23,6 +24,14 @@
2324
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2425
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2526
* THE SOFTWARE.
27+
*
28+
* @class HASHCC::ERR::Exception
29+
* @brief Base exception class for all HASHCC exceptions.
30+
* @ingroup ERR
31+
*
32+
* This is the base class for all exceptions in the HASHCC library.
33+
* It provides basic exception handling functionality including
34+
* message storage, reporting, and error output.
2635
*/
2736

2837
#ifndef __hashccErrException_h__
@@ -44,40 +53,73 @@ namespace ERR {
4453

4554
/******************************************************************************/
4655

56+
/**
57+
* @defgroup CharTypes Character Types
58+
* @brief Character type definitions for ERR namespace
59+
*/
60+
61+
/** @brief Character type @ingroup CharTypes */
4762
typedef HASHCC::Char Char; // stc namespace typedef
63+
/** @brief Constant character type @ingroup CharTypes */
4864
typedef HASHCC::cChar cChar; // stc namespace typedef
65+
/** @brief String type @ingroup CharTypes */
4966
typedef HASHCC::String String; // stc namespace typedef
5067

5168
/******************************************************************************/
5269

70+
/**
71+
* @class HASHCC::ERR::Exception
72+
* @brief Base exception class for all HASHCC exceptions.
73+
* @ingroup ERR
74+
*
75+
* This is the base class for all exceptions in the HASHCC library.
76+
* It provides basic exception handling functionality including
77+
* message storage, reporting, and error output.
78+
*/
5379
class /// base class for errors
5480
Exception {
5581
public:
5682

57-
Exception( void ); /// constructor
58-
Exception( std::exception stdException ); /// constructor
59-
Exception( cChar* message ); /// constructor overloaded
60-
Exception( String message ); /// constructor overloaded
61-
Exception( String message, Int16 lineNo ); /// use __LINE__ @ lineNo
62-
Exception( String message, Char* fileName ); /// use __FILE__ @ fileName
63-
Exception( String message, Char* fileName, Int16 lineNo ); /// use __FILE__ @ fileName and __LINE__ @ lineNo
64-
virtual ~Exception( void ); /// destructor
65-
66-
String declare( void ) const; /// returns message as std::string
67-
void report( void ) const; /// message to console
68-
void stop( void ) const; /// message to console and wait for enter
69-
void nuke( void ) const; /// do a nuke and melt down afterwards
70-
71-
friend std::ostream& operator << ( std::ostream& outputStream, Exception& exception ); /// cout
72-
friend std::ostream& operator << ( std::ostream& outputStream, Exception* exception ); /// cout
83+
/** @brief Default constructor */
84+
Exception( void );
85+
/** @brief Construct from std::exception */
86+
Exception( std::exception stdException );
87+
/** @brief Construct with C-string message */
88+
Exception( cChar* message );
89+
/** @brief Construct with String message */
90+
Exception( String message );
91+
/** @brief Construct with message and line number */
92+
Exception( String message, Int16 lineNo );
93+
/** @brief Construct with message and filename */
94+
Exception( String message, Char* fileName );
95+
/** @brief Construct with message, filename and line number */
96+
Exception( String message, Char* fileName, Int16 lineNo );
97+
/** @brief Destructor */
98+
virtual ~Exception( void );
99+
100+
/** @brief Returns the exception message as std::string */
101+
String declare( void ) const;
102+
/** @brief Reports the exception message to console */
103+
void report( void ) const;
104+
/** @brief Reports to console and waits for user input */
105+
void stop( void ) const;
106+
/** @brief Reports and terminates the program */
107+
void nuke( void ) const;
108+
109+
/** @brief Stream output operator */
110+
friend std::ostream& operator << ( std::ostream& outputStream, Exception& exception );
111+
/** @brief Stream output operator for pointer */
112+
friend std::ostream& operator << ( std::ostream& outputStream, Exception* exception );
73113

74114
protected:
75115

76-
String _message; /// the generated exception message
116+
/** @brief The exception message */
117+
String _message;
77118

78119
private:
79120

80-
virtual void mark( void ); /// mark exception
121+
/** @brief Marks the exception (internal use) */
122+
virtual void mark( void );
81123

82124
}; // class Exception
83125

0 commit comments

Comments
 (0)