(svn r20283) -Codechange: Unify start of doygen comments.
This commit is contained in:
@@ -15,7 +15,8 @@
|
||||
#include "fixedsizearray.hpp"
|
||||
#include "str.hpp"
|
||||
|
||||
/** Flexible array with size limit. Implemented as fixed size
|
||||
/**
|
||||
* Flexible array with size limit. Implemented as fixed size
|
||||
* array of fixed size arrays */
|
||||
template <class T, uint B = 1024, uint N = B>
|
||||
class SmallArray {
|
||||
|
@@ -16,7 +16,8 @@
|
||||
#include "../core/mem_func.hpp"
|
||||
#include <new>
|
||||
|
||||
/** Base class for simple binary blobs.
|
||||
/**
|
||||
* Base class for simple binary blobs.
|
||||
* Item is byte.
|
||||
* The word 'simple' means:
|
||||
* - no configurable allocator type (always made from heap)
|
||||
@@ -102,7 +103,8 @@ protected:
|
||||
return (BlobHeader*)MallocT<byte>(num_bytes);
|
||||
}
|
||||
|
||||
/** Return header pointer to the static BlobHeader with
|
||||
/**
|
||||
* Return header pointer to the static BlobHeader with
|
||||
* both items and capacity containing zero */
|
||||
static FORCEINLINE BlobHeader *Zero()
|
||||
{
|
||||
@@ -231,7 +233,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
/** Reallocate if there is no free space for num_bytes bytes.
|
||||
/**
|
||||
* Reallocate if there is no free space for num_bytes bytes.
|
||||
* @return pointer to the new data to be added */
|
||||
FORCEINLINE byte *Prepare(size_t num_bytes)
|
||||
{
|
||||
@@ -240,7 +243,8 @@ public:
|
||||
return data + Length();
|
||||
}
|
||||
|
||||
/** Increase Length() by num_bytes.
|
||||
/**
|
||||
* Increase Length() by num_bytes.
|
||||
* @return pointer to the new data added */
|
||||
FORCEINLINE byte *Append(size_t num_bytes)
|
||||
{
|
||||
@@ -286,7 +290,8 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
/** Blob - simple dynamic T array. T (template argument) is a placeholder for any type.
|
||||
/**
|
||||
* Blob - simple dynamic T array. T (template argument) is a placeholder for any type.
|
||||
* T can be any integral type, pointer, or structure. Using Blob instead of just plain C array
|
||||
* simplifies the resource management in several ways:
|
||||
* 1. When adding new item(s) it automatically grows capacity if needed.
|
||||
@@ -380,7 +385,8 @@ public:
|
||||
return (T*)base::Append(num_items * type_size);
|
||||
}
|
||||
|
||||
/** Ensures that given number of items can be added to the end of Blob. Returns pointer to the
|
||||
/**
|
||||
* Ensures that given number of items can be added to the end of Blob. Returns pointer to the
|
||||
* first free (unused) item */
|
||||
FORCEINLINE T *MakeFreeSpace(size_t num_items)
|
||||
{
|
||||
|
@@ -12,7 +12,8 @@
|
||||
#ifndef COUNTEDPTR_HPP
|
||||
#define COUNTEDPTR_HPP
|
||||
|
||||
/** CCountedPtr - simple reference counting smart pointer.
|
||||
/**
|
||||
* CCountedPtr - simple reference counting smart pointer.
|
||||
*
|
||||
* One of the standard ways how to maintain object's lifetime.
|
||||
*
|
||||
@@ -136,7 +137,8 @@ template <class T> struct AdaptT {
|
||||
};
|
||||
|
||||
|
||||
/** Simple counted object. Use it as base of your struct/class if you want to use
|
||||
/**
|
||||
* Simple counted object. Use it as base of your struct/class if you want to use
|
||||
* basic reference counting. Your struct/class will destroy and free itself when
|
||||
* last reference to it is released (using Relese() method). The initial reference
|
||||
* count (when it is created) is zero (don't forget AddRef() at least one time if
|
||||
|
@@ -72,7 +72,8 @@ CStrA TileStr(TileIndex tile)
|
||||
return out.Transfer();
|
||||
}
|
||||
|
||||
/** Keep track of the last assigned type_id. Used for anti-recursion.
|
||||
/**
|
||||
* Keep track of the last assigned type_id. Used for anti-recursion.
|
||||
*static*/ size_t& DumpTarget::LastTypeId()
|
||||
{
|
||||
static size_t last_type_id = 0;
|
||||
|
@@ -14,7 +14,8 @@
|
||||
|
||||
#include "../core/alloc_func.hpp"
|
||||
|
||||
/** fixed size array
|
||||
/**
|
||||
* fixed size array
|
||||
* Upon construction it preallocates fixed size block of memory
|
||||
* for all items, but doesn't construct them. Item's construction
|
||||
* is delayed. */
|
||||
@@ -32,7 +33,8 @@ protected:
|
||||
static const uint Tsize = sizeof(T); // size of item
|
||||
static const uint HeaderSize = sizeof(ArrayHeader); // size of header
|
||||
|
||||
/** the only member of fixed size array is pointer to the block
|
||||
/**
|
||||
* the only member of fixed size array is pointer to the block
|
||||
* of C array of items. Header can be found on the offset -sizeof(ArrayHeader). */
|
||||
T *data;
|
||||
|
||||
|
@@ -106,7 +106,8 @@ struct CHashTableSlotT
|
||||
}
|
||||
};
|
||||
|
||||
/** class CHashTableT<Titem, Thash_bits> - simple hash table
|
||||
/**
|
||||
* class CHashTableT<Titem, Thash_bits> - simple hash table
|
||||
* of pointers allocated elsewhere.
|
||||
*
|
||||
* Supports: Add/Find/Remove of Titems.
|
||||
@@ -136,7 +137,8 @@ public:
|
||||
static const int Tcapacity = 1 << Thash_bits; // and num of slots 2^bits
|
||||
|
||||
protected:
|
||||
/** each slot contains pointer to the first item in the list,
|
||||
/**
|
||||
* each slot contains pointer to the first item in the list,
|
||||
* Titem contains pointer to the next item - GetHashNext(), SetHashNext() */
|
||||
typedef CHashTableSlotT<Titem_> Slot;
|
||||
|
||||
|
Reference in New Issue
Block a user