Открытые члены

Класс nitro::Allocator

Класс для работы с памятью. Подробнее...

#include <utilities/allocator.h>

Полный список членов класса

Открытые члены

template<class type >
type * AllocateBlock (void)
template<class type >
type * AllocateArray (const std::size_t &ArrayLength)
template<class type >
void DeallocateBlock (type *Block)
template<class type >
void DeallocateArray (type *Array)

Подробное описание

Класс для работы с памятью.

Автор:
Додонов А.А.

См. определение в файле allocator.h строка 49


Методы

template<class type >
type * nitro::Allocator::AllocateArray ( const std::size_t &  ArrayLength  ) 

Функция выделения памяти под массив.

Аргументы:
ArrayLength - длина массива.
Возвращает:
Указатель на выделенный массив.
Исключения:
nitro::exception Кидает исключение с описанием ошибки.
Автор:
Додонов А.А.

См. определение в файле allocator.h строка 153

Перекрестные ссылки nitro::exception::code() и nitro::exception::what().

        {
                try
                {
                        return( new type[ ArrayLength ] );
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "Allocator::AllocateArray( std::size_t ArrayLength )::" ) + e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( std::string( "Allocator::AllocateArray( std::size_t ArrayLength )::An error occured" ) , 1 ) );
                }
        }

Граф вызовов:

template<class type >
type * nitro::Allocator::AllocateBlock ( void   ) 

Функция выделения блока памяти.

Возвращает:
Указатель на выделенный блок памяти.
Исключения:
nitro::exception Кидает исключение с описанием ошибки.
Автор:
Додонов А.А.

См. определение в файле allocator.h строка 137

Перекрестные ссылки nitro::exception::code() и nitro::exception::what().

Используется в nitro::SharedPointer< managed_type >::SharedPointer().

        {
                try
                {
                        return( new type() );
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "Allocator::AllocateBlock( void )::" ) + e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( std::string( "Allocator::AllocateBlock( void )::An error occured" ) , 1 ) );
                }
        }

Граф вызовов:

template<class type >
void nitro::Allocator::DeallocateArray ( type *  Array  ) 

Функция особождения памяти из под массива.

Аргументы:
Array - Указатель на выделенный массив.
Исключения:
nitro::exception Кидает исключение с описанием ошибки.
Автор:
Додонов А.А.

См. определение в файле allocator.h строка 185

Перекрестные ссылки nitro::exception::code() и nitro::exception::what().

        {
                try
                {
                        delete [] Array;
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "Allocator::DeallocateArray( type * Array )::" ) + e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( std::string( "Allocator::DeallocateArray( type * Array )::An error occured" ) , 1 ) );
                }
        }

Граф вызовов:

template<class type >
void nitro::Allocator::DeallocateBlock ( type *  Block  ) 

Функция освобождения блока памяти.

Аргументы:
Block - Указатель на выделенный блок памяти.
Исключения:
nitro::exception Кидает исключение с описанием ошибки.
Автор:
Додонов А.А.

См. определение в файле allocator.h строка 169

Перекрестные ссылки nitro::exception::code() и nitro::exception::what().

Используется в nitro::SharedPointer< managed_type >::Release().

        {
                try
                {
                        delete Block;
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "Allocator::DeallocateBlock( type * Block )::" ) + e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( std::string( "Allocator::DeallocateBlock( type * Block )::An error occured" ) , 1 ) );
                }
        }

Граф вызовов:


Объявления и описания членов класса находятся в файле:

Generated by  doxygen 1.6.1