1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
enum OwnershipType {REFERENCE_COUNTED, REFERENCE_LINKED, DESTRUCTIVE_COPY, DEEP_COPY, COPY_ON_WRITE};
enum ConversionType {CONVERSION_NOTALLOWED = 0, CONVERSION_ALLOWED};
enum ErrorType {ASSERT_INITIALIZE, ASSERT_DEREFERENCE, REJECT_NULL_INITIALIZE, REJECT_NULL_DEREFERENCE, NO_CHECK};
enum StorageType {RAW_POINTER, ARRAY_POINTER, LOCKED_POINTER};
template
<
typename T,
OwnershipType otype = REFERENCE_COUNTED,
ConversionType ctype = CONVERSION_NOTALLOWED,
ErrorType etype = ASSERT_INITIALIZE,
StorageType stype = RAW_POINTER
>
class CPointer {};
template <typename T, OwnershipType otype, ConversionType ctype, ErrorType etype, StorageType stype> class CPointer <T, REFERENCE_COUNTED, ctype, etype, stype>
{defintion...};
template <typename T, OwnershipType otype, ConversionType ctype, ErrorType etype, StorageType stype> class CPointer <T, REFERENCE_LINKED, ctype, etype, stype>
{definition...};
template <typename T, OwnershipType otype, ConversionType ctype, ErrorType etype, StorageType stype> class CPointer <T, DESTRUCTIVE_COPY, ctype, etype, stype>
{definition...};
template <typename T, OwnershipType otype, ConversionType ctype, ErrorType etype, StorageType stype> class CPointer <T, DEEP_COPY, ctype, etype, stype>
{definition...};
template <typename T, OwnershipType otype, ConversionType ctype, ErrorType etype, StorageType stype> class CPointer <T, COPY_ON_WRITE, ctype, etype, stype>
{definition...};
|