xoreos  0.0.5
Public Types | Public Member Functions | Private Attributes | List of all members
Common::ScopedPtrBase< T, Deallocator > Class Template Reference

Base template class for a scoped pointer. More...

#include <scopedptr.h>

Inherits noncopyable.

Inherited by Common::ScopedArray< T, Deallocator >, and Common::ScopedPtr< T, Deallocator >.

Collaboration diagram for Common::ScopedPtrBase< T, Deallocator >:
Collaboration graph
[legend]

Public Types

typedef T ValueType
 
typedef T * PointerType
 
typedef T & ReferenceType
 

Public Member Functions

 ScopedPtrBase (PointerType o=0)
 
XOREOS_EXPLICIT_OPERATOR_CONV operator bool () const
 Implicit conversion operator to bool for convenience, to make checks like "if (scopedPtr) ..." possible. More...
 
 ~ScopedPtrBase ()
 
void reset (PointerType o=0)
 Resets the pointer with the new value. More...
 
PointerType get () const
 Returns the plain pointer value. More...
 
PointerType release ()
 Returns the plain pointer value and releases ScopedPtr. More...
 
void swap (ScopedPtrBase< T, Deallocator > &right)
 Swap the managed pointers of two ScopedPtrs of the same type. More...
 

Private Attributes

PointerType _pointer
 

Detailed Description

template<typename T, class Deallocator>
class Common::ScopedPtrBase< T, Deallocator >

Base template class for a scoped pointer.

Manages the pointer and allows for automatic deletion throw a deallocator template parameter.

Definition at line 69 of file scopedptr.h.

Member Typedef Documentation

◆ PointerType

template<typename T, class Deallocator>
typedef T* Common::ScopedPtrBase< T, Deallocator >::PointerType

Definition at line 72 of file scopedptr.h.

◆ ReferenceType

template<typename T, class Deallocator>
typedef T& Common::ScopedPtrBase< T, Deallocator >::ReferenceType

Definition at line 73 of file scopedptr.h.

◆ ValueType

template<typename T, class Deallocator>
typedef T Common::ScopedPtrBase< T, Deallocator >::ValueType

Definition at line 71 of file scopedptr.h.

Constructor & Destructor Documentation

◆ ScopedPtrBase()

template<typename T, class Deallocator>
Common::ScopedPtrBase< T, Deallocator >::ScopedPtrBase ( PointerType  o = 0)
inlineexplicit

Definition at line 75 of file scopedptr.h.

◆ ~ScopedPtrBase()

template<typename T, class Deallocator>
Common::ScopedPtrBase< T, Deallocator >::~ScopedPtrBase ( )
inline

Definition at line 82 of file scopedptr.h.

Member Function Documentation

◆ get()

template<typename T, class Deallocator>
PointerType Common::ScopedPtrBase< T, Deallocator >::get ( ) const
inline

Returns the plain pointer value.

Returns
the pointer the ScopedPtr manages.

Definition at line 96 of file scopedptr.h.

Referenced by Graphics::Aurora::CursorManager::add(), Graphics::Aurora::FontManager::add(), Graphics::Aurora::TextureManager::add(), Common::blowfishEBC(), Graphics::Aurora::PLTFile::build(), Engines::KotOR::CharacterGenerationMenu::CharacterGenerationMenu(), Aurora::compress10(), Common::ConversionManager::convert(), Aurora::createDepth(), Video::Bink::BinkAudioTrack::decodeAudio(), Video::XMVWMV2Codec::decodeFrame(), Video::XMVWMV2Codec::decodeIFrame(), Video::Bink::decodeNextTrackFrame(), Video::Bink::BinkVideoTrack::decodePacket(), Sound::WMACodec::decodeSuperFrame(), Graphics::ImageDecoder::decompress(), Common::decompressDeflate(), Common::decompressDeflateChunk(), Common::decompressDeflateWithoutOutputSize(), Common::decompressLZMA1(), Engines::NWN::Version::detectLinux(), Engines::KotOR::Version::detectMacOSX(), Engines::NWN::Version::detectMacOSX(), Engines::KotOR::Version::detectWindows(), Engines::NWN::Version::detectWindows(), Engines::KotOR::Version::detectXbox(), Common::ConversionManager::doConvert(), Sound::SoundManager::fillBuffer(), Graphics::flipHorizontally(), Graphics::Aurora::PLTFile::getColorRows(), Engines::ConsoleWindow::getHighlight(), Common::FoxPro::getMemo(), Engines::KotOR::CharacterGenerationInfo::getModel(), Engines::KotORJadeWidget::getQuadHighlightableComponent(), Aurora::TheWitcherSaveFile::getResource(), Aurora::NDSFile::getResource(), Aurora::HERFFile::getResource(), Aurora::OBBFile::getResource(), Aurora::RIMFile::getResource(), Aurora::BIFFile::getResource(), Aurora::ERFFile::getResource(), Common::FFT::getRevTab(), Engines::NWN2::Object::getSSF(), Engines::NWN::Object::getSSF(), Engines::NWN::NWNWidgetWithCaption::getText(), Engines::KotORJadeWidget::getTextHighlightableComponent(), Engines::ConsoleWindow::highlightClip(), Engines::ConsoleWindow::highlightLine(), Engines::ConsoleWindow::highlightWord(), Video::XMVWMV2Codec::initDecodeContext(), Graphics::NBFS::load(), Aurora::LTRFile::load(), Graphics::Aurora::PLTFile::load(), Common::ConfigFile::load(), Aurora::TalkTable_GFF::load02(), Aurora::TalkTable_GFF::load05(), Aurora::GFF4File::loadHeader(), Engines::Sonic::AreaMiniMap::loadMiniMap(), Engines::Sonic::loadNCGR(), Engines::Sonic::AreaBackground::loadTexture(), Engines::KotOR::MainMenu::MainMenu(), Common::MDCT::MDCT(), Graphics::ImageDecoder::MipMap::MipMap(), Common::ScopedPtr< Engines::Witcher::Game >::operator*(), Common::ScopedPtr< Engines::Witcher::Game >::operator->(), Common::ScopedArray< Video::QuickTimeDecoder::TimeToSampleEntry >::operator[](), Sound::PacketizedVorbisStream::parseExtraData(), Engines::NWN::Portrait::Portrait(), Video::XboxMediaVideo::processNextFrame(), Video::XboxMediaVideo::processPacketHeader(), Video::QuickTimeDecoder::QuickTimeAudioTrack::readAudioChunk(), Aurora::GFXFile::readColorTransform(), Graphics::TXB::readData(), Graphics::WinIconImage::readData(), Aurora::GFXFile::readDefineEditText(), Aurora::GFXFile::readDefineFont(), Video::QuickTimeDecoder::readESDS(), Engines::KotOR::Version::readFile(), Engines::NWN::Version::readFile(), Aurora::GFXFile::readFileAttributes(), Aurora::GFXFile::readFillStyle(), Aurora::GFXFile::readMatrix(), Graphics::NBFS::readPalette(), Graphics::NCLR::readPalette(), Aurora::GFXFile::readPlaceObject(), Aurora::GFXFile::readRecordHeader(), Aurora::GFXFile::readRectangle(), Aurora::GFXFile::readShape(), Common::ReadStream::readStream(), Aurora::ERFFile::readV30Header(), Aurora::ERFFile::readV30ResList(), Graphics::Aurora::Texture::setMipMapData(), Engines::KotOR::DialogGUIBase::stopSounds(), Graphics::takeScreenshot(), Engines::KotOR::SaveLoadMenu::tryLoadGame(), Graphics::TTFRenderer::TTFRenderer(), and Graphics::writeMipMap().

◆ operator bool()

template<typename T, class Deallocator>
XOREOS_EXPLICIT_OPERATOR_CONV Common::ScopedPtrBase< T, Deallocator >::operator bool ( ) const
inline

Implicit conversion operator to bool for convenience, to make checks like "if (scopedPtr) ..." possible.

Definition at line 80 of file scopedptr.h.

◆ release()

template<typename T, class Deallocator>
PointerType Common::ScopedPtrBase< T, Deallocator >::release ( )
inline

Returns the plain pointer value and releases ScopedPtr.

After the release() call, you need to delete the object yourself.

Returns
the pointer the ScopedPtr manages.

Definition at line 103 of file scopedptr.h.

Referenced by Graphics::Aurora::CursorManager::add(), Graphics::Aurora::FontManager::add(), Graphics::Aurora::TextureManager::add(), Common::blowfishEBC(), Common::ConversionManager::convert(), Engines::NWN::createNewGameFog(), Video::Bink::BinkAudioTrack::decodeAudio(), Sound::WMACodec::decodeSuperFrame(), Aurora::Small::decompress(), Aurora::ERFFile::decompress(), Common::decompressDeflate(), Common::decompressDeflateWithoutOutputSize(), Common::decompressLZMA1(), Common::ConversionManager::doConvert(), Engines::KotOR2::CharacterGenerationInfo::getCharacter(), Engines::KotOR::CharacterGenerationInfo::getCharacter(), Sound::WwiseSoundBank::getFile(), Graphics::Aurora::PLTFile::getLayerPalette(), Common::FoxPro::getMemo(), Aurora::OBBFile::getResource(), Sound::WwiseSoundBank::getSound(), Aurora::ResourceManager::indexArchive(), Graphics::NCLR::load(), Aurora::CDPTH::load(), Graphics::Aurora::Cursor::load(), Aurora::TalkTable::load(), Common::ConfigFile::load(), Aurora::TalkTable_GFF::load02(), Aurora::TalkTable_GFF::load05(), Aurora::TwoDARegistry::load2DA(), Aurora::TwoDARegistry::loadGDA(), Aurora::TwoDARegistry::loadMGDA(), Engines::Sonic::AreaMiniMap::loadMiniMap(), Engines::Sonic::loadNCGR(), Aurora::loadTables(), Engines::Sonic::AreaBackground::loadTexture(), Sound::makeMP3Stream(), Sound::makePacketizedVorbisStream(), Sound::makeVorbisStream(), Video::makeVP8Decoder(), Video::makeVP9Decoder(), Aurora::NitroFile::open(), Engines::EngineManager::probeGame(), Video::QuickTimeDecoder::QuickTimeAudioTrack::queueAudio(), Graphics::DDS::readBioWareHeader(), Sound::WwRIFFVorbisStream::readBuffer(), Engines::KotOR::Version::readFile(), Engines::NWN::Version::readFile(), Graphics::TPC::readHeader(), Graphics::TXB::readHeader(), Graphics::NBFS::readPalette(), Graphics::NCLR::readPalette(), Aurora::TwoDAFile::readRows2a(), Video::QuickTimeDecoder::readSampleDesc(), Common::ReadStream::readStream(), and Engines::Jade::Game::runModule().

◆ reset()

template<typename T, class Deallocator>
void Common::ScopedPtrBase< T, Deallocator >::reset ( PointerType  o = 0)
inline

Resets the pointer with the new value.

The old object will be destroyed.

Definition at line 87 of file scopedptr.h.

Referenced by Video::Bink::BinkVideoTrack::BinkVideoTrack(), Engines::Witcher::Area::clear(), Aurora::GFF4File::clear(), Engines::Console::Console(), Engines::ConsoleWindow::ConsoleWindow(), Aurora::createDepth(), Engines::KotORJadeWidget::createText(), Common::DCT::DCT(), Video::VPXDecoder::decodeFrame(), Sound::WMACodec::decodeSuperFrame(), Graphics::ImageDecoder::decompress(), Aurora::ERFFile::decryptNWNPremium(), Engines::KotOR::Version::detectMacOSX(), Engines::NWN::Dialog::Dialog(), Engines::NWN::DialogBox::DialogBox(), Common::FFT::FFT(), Sound::FMODSampleBank::FMODSampleBank(), Graphics::FPSCounter::FPSCounter(), Sound::WwRIFFVorbisStream::generateHeaderSetup(), Engines::KotOR::CharacterGenerationInfo::getModel(), Aurora::NSBTXFile::getPalette(), Aurora::GFF3File::GFF3File(), Aurora::GFF4File::GFF4File(), Aurora::ResourceManager::indexArchive(), Video::XMVWMV2Codec::init(), Engines::NWN::NWNWidgetWithCaption::initCaption(), Sound::WMACodec::initCoefHuffman(), Sound::WMACodec::initExponents(), Sound::WMACodec::initNoise(), Video::VideoDecoder::initVideo(), Engines::WidgetScrollbar::load(), Engines::KotORInventoryItem::load(), Graphics::NCLR::load(), Engines::WidgetProgressbar::load(), Engines::KotOR::Trigger::load(), Engines::KotOR2::Trigger::load(), Engines::KotORJadeWidget::load(), Aurora::LTRFile::load(), Engines::Jade::Room::load(), Graphics::Aurora::Cursor::load(), Engines::KotOR::Room::load(), Engines::KotOR2::Room::load(), Engines::KotOR::Waypoint::load(), Engines::KotOR2::Waypoint::load(), Engines::NWN::Waypoint::load(), Engines::NWN2::Waypoint::load(), Engines::Witcher::Waypoint::load(), Engines::DragonAge::Placeable::load(), Engines::DragonAge2::Placeable::load(), Graphics::Aurora::PLTFile::load(), Engines::Sonic::Placeable::load(), Engines::Witcher::Door::load(), Graphics::NCGR::load(), Engines::Witcher::Placeable::load(), Engines::KotOR2::Placeable::load(), Engines::NWN2::Placeable::load(), Engines::Jade::GUI::load(), Engines::KotOR::GUI::load(), Engines::KotOR::Placeable::load(), Engines::NWN::Item::load(), Engines::NWN::Placeable::load(), Engines::KotOR::Door::load(), Engines::KotOR2::Door::load(), Engines::KotOR2::Situated::load(), Engines::NWN2::Door::load(), Engines::KotOR::Situated::load(), Engines::NWN::Door::load(), Engines::KotOR2::Creature::load(), Common::ConfigFile::load(), Engines::KotOR::Creature::load(), Engines::NWN2::Creature::load(), Aurora::GFXFile::load(), Engines::NWN::Creature::load(), Aurora::TwoDARegistry::load2DA(), Engines::Jade::Placeable::loadAppearance(), Engines::Witcher::Area::loadAreaModel(), Engines::Jade::Creature::loadBody(), Engines::KotOR2::Creature::loadBody(), Engines::KotOR::Creature::loadBody(), Engines::NWN2::Campaign::loadCampaignResource(), Aurora::TwoDARegistry::loadGDA(), Aurora::GFF4File::loadHeader(), Engines::Jade::Placeable::loadInstance(), Aurora::TwoDARegistry::loadMGDA(), Engines::Sonic::AreaMiniMap::loadMiniMap(), Engines::NWN2::Situated::loadModel(), Engines::NWN::Situated::loadModel(), Engines::Witcher::Situated::loadModel(), Engines::NWN::Item::loadModel(), Engines::NWN::Creature::loadModel(), Engines::LoadProgress::LoadProgress(), Engines::NWN2::Object::loadSSF(), Engines::NWN::Object::loadSSF(), Engines::KotOR::MainMenu::MainMenu(), Common::MDCT::MDCT(), Graphics::ImageDecoder::MipMap::MipMap(), Aurora::NWScript::NCSFile::NCSFile(), Aurora::NDSFile::NDSFile(), Aurora::NSBTXFile::NSBTXFile(), Sound::PacketizedVorbisStream::parseExtraData(), Sound::ASFStream::parseStreamHeader(), Aurora::PEFile::PEFile(), Engines::KotOR::DialogGUIBase::playSounds(), Engines::NWN::Portrait::Portrait(), Engines::NWN::QuadWidget::QuadWidget(), Engines::NWN::QuickbarButton::QuickbarButton(), Graphics::TPC::readData(), Video::QuickTimeDecoder::readESDS(), Video::QuickTimeDecoder::readSTCO(), Video::QuickTimeDecoder::readSTSS(), Video::QuickTimeDecoder::readSTSZ(), Aurora::ERFFile::readV30Header(), Engines::NWN::Tooltip::redoBubble(), Sound::WwRIFFVorbisStream::rewind(), Engines::Jade::Game::run(), Engines::KotORJadeWidget::setFill(), Engines::KotORJadeWidget::setHighlight(), Engines::NWN::WidgetEditBox::setTitle(), Engines::Engine::showFPS(), Engines::KotOR::SoundObject::SoundObject(), Engines::KotOR::DialogGUIBase::startConversation(), Engines::KotOR::DialogGUIBase::stopSounds(), Graphics::TTFRenderer::TTFRenderer(), Engines::Jade::Room::unload(), Engines::Witcher::Area::unloadAreaModel(), Engines::NWN2::Situated::unloadModel(), Engines::NWN::Situated::unloadModel(), Engines::Witcher::Situated::unloadModel(), Engines::NWN::Item::unloadModel(), Engines::NWN::Creature::unloadModel(), Engines::NWN::WidgetListItemBaseButton::WidgetListItemBaseButton(), Engines::NWN::WidgetListItemButton::WidgetListItemButton(), Engines::NWN::WidgetListItemCharacter::WidgetListItemCharacter(), Engines::NWN::WidgetListItemModule::WidgetListItemModule(), Engines::NWN::WidgetListItemPremium::WidgetListItemPremium(), Engines::NWN::WidgetListItemTextLine::WidgetListItemTextLine(), Engines::NWN::WidgetListItemVoice::WidgetListItemVoice(), Engines::WidgetPanel::WidgetPanel(), Sound::WwiseSoundBank::WwiseSoundBank(), Video::XboxMediaVideo::XMVAudioTrack::XMVAudioTrack(), and Aurora::ZIPFile::ZIPFile().

◆ swap()

template<typename T, class Deallocator>
void Common::ScopedPtrBase< T, Deallocator >::swap ( ScopedPtrBase< T, Deallocator > &  right)
inline

Swap the managed pointers of two ScopedPtrs of the same type.

Definition at line 110 of file scopedptr.h.

Referenced by Graphics::TPC::fixupCubeMap(), and Graphics::TXB::readData().

Here is the caller graph for this function:

Member Data Documentation

◆ _pointer

template<typename T, class Deallocator>
PointerType Common::ScopedPtrBase< T, Deallocator >::_pointer
private

The documentation for this class was generated from the following file: