Dali 3D User Interface Engine
List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
Dali::BaseHandle Class Reference

Dali::BaseHandle is a handle to an internal Dali resource. More...

#include <base-handle.h>

Inheritance diagram for Dali::BaseHandle:
Inheritance graph
[legend]
Collaboration diagram for Dali::BaseHandle:
Collaboration graph
[legend]

Public Types

typedef void(BaseHandle::* BooleanType )() const
 Pointer-to-member type. More...
 

Public Member Functions

 BaseHandle (Dali::BaseObject *handle)
 This constructor is used by Dali New() methods. More...
 
 BaseHandle ()
 This constructor provides an uninitialized Dali::BaseHandle. More...
 
 ~BaseHandle ()
 Dali::BaseHandle is intended as a base class. More...
 
 BaseHandle (const BaseHandle &handle)
 This copy constructor is required for (smart) pointer semantics. More...
 
BaseHandleoperator= (const BaseHandle &rhs)
 This assignment operator is required for (smart) pointer semantics. More...
 
template<class T >
bool ConnectSignal (ConnectionTrackerInterface *connectionTracker, const std::string &signalName, const T &functor)
 Connects a void() functor to a specified signal. More...
 
bool DoAction (const std::string &actionName, const Property::Map &attributes)
 Perform action on this object with the given action name and attributes. More...
 
const std::string & GetTypeName () const
 Returns the type name for the Handle. More...
 
bool GetTypeInfo (Dali::TypeInfo &info) const
 Returns the type info for the Handle. More...
 
BaseObjectGetBaseObject ()
 Retrieve the internal Dali resource. More...
 
const BaseObjectGetBaseObject () const
 Retrieve the internal Dali resource. More...
 
void Reset ()
 Resets the handle. More...
 
 operator BooleanType () const
 Converts an handle to a BooleanType. More...
 
bool operator== (const BaseHandle &rhs) const
 Equality operator overload. More...
 
bool operator!= (const BaseHandle &rhs) const
 Inequality operator overload. More...
 
Dali::RefObjectGetObjectPtr () const
 Get the reference counted object pointer. More...
 

Protected Member Functions

void ThisIsSaferThanReturningVoidStar () const
 Used by the safe bool idiom. More...
 

Private Member Functions

bool DoConnectSignal (ConnectionTrackerInterface *connectionTracker, const std::string &signalName, FunctorDelegate *functorDelegate)
 Not intended for application developers. More...
 

Private Attributes

IntrusivePtr< Dali::RefObjectmObjectHandle
 Object this handle points at. More...
 

Detailed Description

Dali::BaseHandle is a handle to an internal Dali resource.

Each Dali handle consists of a single private pointer, and a set of non-virtual forwarding functions. This hides the internal implementation, so it may be modified without affecting the public interface.

Dali handles have implicit smart-pointer semantics. This avoids the need to match resource allocation methods like new/delete (the RAII idiom).

Dali handles can be copied by value. When a Dali handle is copied, both the copy and original will point to the same Dali resource.

The internal Dali resources are reference counted. copying a Dali handle will increase the reference count. A resource will not be deleted until all its Dali::BaseHandle handles are destroyed, or reset.

.0

Definition at line 59 of file base-handle.h.

Member Typedef Documentation

typedef void(BaseHandle::* Dali::BaseHandle::BooleanType)() const

Pointer-to-member type.

Objects can be implicitly converted to this for validity checks.

Definition at line 197 of file base-handle.h.

Constructor & Destructor Documentation

BaseHandle::BaseHandle ( Dali::BaseObject handle)

This constructor is used by Dali New() methods.

.0

Parameters
[in]handleA pointer to a newly allocated Dali resource

Definition at line 32 of file base-handle.cpp.

BaseHandle::BaseHandle ( )

This constructor provides an uninitialized Dali::BaseHandle.

This should be initialized with a Dali New() method before use. Methods called on an uninitialized Dali::BaseHandle will assert.

BaseHandle handle; // uninitialized
handle.SomeMethod(); // unsafe! This will assert
handle = SomeClass::New(); // now initialized
handle.SomeMethod(); // safe

.0

Definition at line 37 of file base-handle.cpp.

Referenced by Dali::Toolkit::Internal::Control::Impl::GetProperty(), and Dali::Toolkit::Internal::Control::Impl::SetProperty().

Here is the caller graph for this function:

BaseHandle::~BaseHandle ( )

Dali::BaseHandle is intended as a base class.

This is non-virtual since derived BaseHandle types must not contain data. .0

Definition at line 41 of file base-handle.cpp.

BaseHandle::BaseHandle ( const BaseHandle handle)

This copy constructor is required for (smart) pointer semantics.

.0

Parameters
[in]handleA reference to the copied handle

Definition at line 45 of file base-handle.cpp.

Member Function Documentation

template<class T >
bool Dali::BaseHandle::ConnectSignal ( ConnectionTrackerInterface connectionTracker,
const std::string &  signalName,
const T &  functor 
)
inline

Connects a void() functor to a specified signal.

.0

Parameters
[in]connectionTrackerA connection tracker which can be used to disconnect.
[in]signalNameName of the signal to connect to.
[in]functorThe functor to copy.
Returns
True if the signal was available.
Precondition
The signal must be available in this object.

Definition at line 124 of file base-handle.h.

References Dali::Toolkit::anonymous_namespace{control-impl.cpp}::DoConnectSignal(), and Dali::FunctorDelegate::New().

Referenced by Dali::Toolkit::Internal::FeedbackStyle::ObjectCreated(), UtcDaliBaseHandleConnectSignal(), UtcDaliConfirmationPopupDynamicSignalGenerationN(), UtcDaliConfirmationPopupDynamicSignalGenerationP(), UtcDaliControlGestureSignals(), UtcDaliLongPressGestureDetectorTypeRegistry(), UtcDaliPanGestureDetectorTypeRegistry(), UtcDaliPinchGestureDetectorTypeRegistry(), UtcDaliPopupPropertyTypeRegistryConnectSignal(), UtcDaliTapGestureDetectorTypeRegistry(), UtcDaliTypeRegistrySignalConnectorTypeN(), UtcDaliTypeRegistrySignalConnectorTypeP(), and UtcDaliTypeRegistryTypeRegistrationNotCallingCreateOnInitP().

Here is the call graph for this function:

Here is the caller graph for this function:

bool BaseHandle::DoAction ( const std::string &  actionName,
const Property::Map attributes 
)

Perform action on this object with the given action name and attributes.

.0

Parameters
[in]actionNameThe command for the action.
[in]attributesThe list of attributes for the action.
Returns
The action is performed by the object or not.

Definition at line 60 of file base-handle.cpp.

References Dali::Internal::Actor::DoAction(), and Dali::GetImplementation().

Referenced by anonymous_namespace{builder-signals.cpp}::ChildActorAction::operator()(), anonymous_namespace{builder-signals.cpp}::GenericAction::operator()(), UtcDaliBaseHandleDoAction(), UtcDaliControlImplOnAccessibilityActivatedP(), UtcDaliCustomActorDoAction(), UtcDaliTypeRegistryActionViaBaseHandle(), UtcDaliTypeRegistryTypeActionN(), UtcDaliTypeRegistryTypeActionP(), and UtcDaliTypeRegistryTypeRegistrationNotCallingCreateOnInitP().

Here is the call graph for this function:

Here is the caller graph for this function:

bool BaseHandle::DoConnectSignal ( ConnectionTrackerInterface connectionTracker,
const std::string &  signalName,
FunctorDelegate functorDelegate 
)
private

Not intended for application developers.

.0

Parameters
[in]connectionTrackerA connection tracker which can be used to disconnect.
[in]signalNameName of the signal to connect to.
[in]functorDelegateA newly allocatated functor delegate (takes ownership).
Returns
True if the signal was available.

Definition at line 110 of file base-handle.cpp.

References Dali::Internal::Actor::DoConnectSignal(), and Dali::GetImplementation().

Here is the call graph for this function:

BaseObject & BaseHandle::GetBaseObject ( )

Retrieve the internal Dali resource.

This is useful for checking the reference count of the internal resource. This method will not check the validity of the handle so the caller is expected to check it by using if (handle) .0

Returns
The BaseObject which is referenced by the BaseHandle.

Definition at line 75 of file base-handle.cpp.

Referenced by Dali::Internal::TypeInfo::CreateInstance(), Dali::Toolkit::Internal::KeyInputFocusManager::FindFocusControlInStack(), Dali::GetImpl(), Dali::Toolkit::GetImpl(), Dali::GetImplementation(), Dali::Toolkit::Text::GetImplementation(), Dali::Internal::Adaptor::ClipboardEventNotifier::GetImplementation(), Dali::Toolkit::GetImplementation(), Dali::Internal::Adaptor::AccessibilityAdaptor::GetImplementation(), Dali::Internal::Adaptor::GetImplementation(), anonymous_namespace{utc-Dali-Handle.cpp}::ImplicitCopyConstructor(), anonymous_namespace{utc-Dali-BaseHandle.cpp}::ImplicitCopyConstructor(), Dali::PhysicalKeyboard::IsAttached(), Dali::Internal::Adaptor::ObjectProfiler::OnObjectCreated(), Dali::Internal::HoverEventProcessor::ProcessHoverEvent(), Dali::Internal::TouchEventProcessor::ProcessTouchEvent(), Dali::Internal::WheelEventProcessor::ProcessWheelEvent(), Dali::Toolkit::Internal::KeyInputFocusManager::SetFocus(), Dali::PhysicalKeyboard::StatusChangedSignal(), UtcDaliBaseHandleAssignmentOperator(), UtcDaliBaseHandleCopyConstructor(), UtcDaliHandleAssignmentOperator(), UtcDaliHandleCopyConstructor(), UtcDaliSamplerCopyConstructor(), UtcDaliWeakHandleBaseAssignmentOperator(), and UtcDaliWeakHandleBaseCopyConstructor().

Here is the caller graph for this function:

const BaseObject & BaseHandle::GetBaseObject ( ) const

Retrieve the internal Dali resource.

This is useful for checking the reference count of the internal resource. This method will not check the validity of the handle so the caller is expected to check it by using if (handle) .0

Returns
The BaseObject which is referenced by the BaseHandle.

Definition at line 80 of file base-handle.cpp.

Dali::RefObject * BaseHandle::GetObjectPtr ( ) const

Get the reference counted object pointer.

.0

Returns
A pointer to the reference counted object.

Definition at line 105 of file base-handle.cpp.

References Dali::IntrusivePtr< T >::Get(), and mObjectHandle.

Referenced by Dali::Toolkit::Internal::ScrollView::AnimateInternalXTo(), Dali::Toolkit::Internal::ScrollView::AnimateInternalYTo(), Dali::Toolkit::Internal::Builder::DoCreate(), Dali::Toolkit::DownCast(), Dali::CustomActor::DownCast(), Dali::RenderTaskList::DownCast(), Dali::KeyFrames::DownCast(), Dali::Sampler::DownCast(), Dali::GestureDetector::DownCast(), Dali::PathConstrainer::DownCast(), Dali::Material::DownCast(), Dali::Path::DownCast(), Dali::PropertyNotification::DownCast(), Dali::LinearConstrainer::DownCast(), Dali::NinePatchImage::DownCast(), Dali::Toolkit::ScrollViewPagePathEffect::DownCast(), Dali::PinchGestureDetector::DownCast(), Dali::Geometry::DownCast(), Dali::PropertyBuffer::DownCast(), Dali::Renderer::DownCast(), Dali::NativeImage::DownCast(), Dali::TapGestureDetector::DownCast(), Dali::Timer::DownCast(), Dali::LongPressGestureDetector::DownCast(), Dali::Image::DownCast(), Dali::PanGestureDetector::DownCast(), Dali::Shader::DownCast(), Dali::Handle::DownCast(), Dali::Atlas::DownCast(), Dali::FrameBufferImage::DownCast(), Dali::CameraActor::DownCast(), Dali::EncodedBufferImage::DownCast(), Dali::RenderTask::DownCast(), Dali::BufferImage::DownCast(), Dali::Animation::DownCast(), Dali::Layer::DownCast(), Dali::ResourceImage::DownCast(), Dali::ShaderEffect::DownCast(), Dali::ImageActor::DownCast(), Dali::Actor::DownCast(), Dali::Constraint::DownCast(), Dali::Toolkit::Internal::KeyboardFocusManager::Get(), Dali::Internal::Adaptor::PhysicalKeyboard::Get(), Dali::Toolkit::Internal::StyleManager::Get(), Dali::Internal::Adaptor::ClipboardEventNotifier::Get(), Dali::Internal::Adaptor::SoundPlayer::Get(), Dali::Internal::Adaptor::LifecycleController::Get(), Dali::Toolkit::Text::Internal::Backend::Get(), Dali::Internal::Adaptor::FeedbackPlayer::Get(), Dali::Internal::Adaptor::StyleMonitor::Get(), Dali::Toolkit::RendererFactory::Get(), Dali::Toolkit::AtlasGlyphManager::Get(), Dali::Toolkit::KeyInputFocusManager::Get(), Dali::Toolkit::Text::Internal::MultilanguageSupport::Get(), Dali::Toolkit::AccessibilityManager::Get(), Dali::WeakHandleBase::Impl::Impl(), Dali::Toolkit::Internal::ScrollView::OnScrollAnimationFinished(), Dali::operator<(), UtcDaliBaseHandleGetObjectPtr(), UtcDaliObjectRegistrySignalActorCreated(), UtcDaliObjectRegistrySignalAnimationCreated(), UtcDaliObjectRegistrySignalCameraCreated(), UtcDaliObjectRegistrySignalImageActorCreated(), UtcDaliObjectRegistrySignalLayerCreated(), and UtcDaliObjectRegistrySignalShaderEffectCreated().

Here is the call graph for this function:

bool BaseHandle::GetTypeInfo ( Dali::TypeInfo info) const

Returns the type info for the Handle.

.0

Returns
The type info.

Definition at line 70 of file base-handle.cpp.

References Dali::GetImplementation(), and Dali::Internal::Object::GetTypeInfo().

Referenced by UtcDaliBaseHandleGetTypeInfoN(), and UtcDaliBaseHandleGetTypeInfoP().

Here is the call graph for this function:

Here is the caller graph for this function:

const std::string & BaseHandle::GetTypeName ( ) const

Returns the type name for the Handle.

Will return an empty string if the typename does not exist. This will happen for types that have not registered with type-registry.

.0

Returns
The type name. Empty string if the typename does not exist.

Definition at line 65 of file base-handle.cpp.

References Dali::GetImplementation(), and Dali::BaseObject::GetTypeName().

Referenced by Dali::Toolkit::Internal::StyleManager::ApplyStyle(), Dali::Scripting::CreatePropertyMap(), Dali::Toolkit::Internal::FeedbackStyle::ObjectCreated(), Dali::Internal::Adaptor::ObjectProfiler::OnObjectCreated(), Dali::Internal::RelayoutController::Relayout(), UtcDaliBaseHandleGetTypeNameP(), and UtcDaliCustomActorTypeRegistry().

Here is the call graph for this function:

Here is the caller graph for this function:

BaseHandle::operator BaseHandle::BooleanType ( ) const

Converts an handle to a BooleanType.

This is useful for checking whether the handle is empty. .0

Definition at line 90 of file base-handle.cpp.

References mObjectHandle, and ThisIsSaferThanReturningVoidStar().

Here is the call graph for this function:

bool BaseHandle::operator!= ( const BaseHandle rhs) const

Inequality operator overload.

.0

Parameters
[in]rhsA reference to the compared handle.
Returns
true if the handle handles point to the different Dali resources.

Definition at line 100 of file base-handle.cpp.

References mObjectHandle.

BaseHandle & BaseHandle::operator= ( const BaseHandle rhs)

This assignment operator is required for (smart) pointer semantics.

It makes this handle use the same BaseObject as the copied handle .0

Parameters
[in]rhsA reference to the copied handle
Returns
A reference to this handle

Definition at line 50 of file base-handle.cpp.

References mObjectHandle.

Referenced by Dali::StyleMonitor::operator=(), Dali::Toolkit::ControlRenderer::operator=(), Dali::PropertyCondition::operator=(), Dali::NativeImage::operator=(), Dali::Sampler::operator=(), Dali::Material::operator=(), Dali::Toolkit::Text::Backend::operator=(), Dali::Toolkit::RendererFactory::operator=(), Dali::Toolkit::ImageAtlas::operator=(), Dali::RenderTaskList::operator=(), Dali::Timer::operator=(), Dali::GestureDetector::operator=(), Dali::KeyFrames::operator=(), Dali::PathConstrainer::operator=(), Dali::Geometry::operator=(), Dali::PropertyNotification::operator=(), Dali::Image::operator=(), Dali::ObjectRegistry::operator=(), Dali::Path::operator=(), Dali::NinePatchImage::operator=(), Dali::CustomActor::operator=(), Dali::Renderer::operator=(), Dali::PropertyBuffer::operator=(), Dali::TypeInfo::operator=(), Dali::TtsPlayer::operator=(), Dali::PinchGestureDetector::operator=(), Dali::LinearConstrainer::operator=(), Dali::Stage::operator=(), Dali::Handle::operator=(), Dali::TypeRegistry::operator=(), Dali::TapGestureDetector::operator=(), Dali::Shader::operator=(), Dali::ResourceImage::operator=(), Dali::LongPressGestureDetector::operator=(), Dali::Window::operator=(), Dali::PanGestureDetector::operator=(), Dali::Atlas::operator=(), Dali::Application::operator=(), Dali::FrameBufferImage::operator=(), Dali::CameraActor::operator=(), Dali::EncodedBufferImage::operator=(), Dali::RenderTask::operator=(), Dali::BufferImage::operator=(), Dali::Animation::operator=(), Dali::Layer::operator=(), Dali::ShaderEffect::operator=(), Dali::ImageActor::operator=(), Dali::Actor::operator=(), and Dali::Constraint::operator=().

Here is the caller graph for this function:

bool BaseHandle::operator== ( const BaseHandle rhs) const

Equality operator overload.

.0

Parameters
[in]rhsA reference to the compared handle.
Returns
true if the handle handles point to the same Dali resource, or if both are NULL.

Definition at line 95 of file base-handle.cpp.

References mObjectHandle.

void BaseHandle::Reset ( )

Resets the handle.

If no other handle copies exist, the internal Dali resouce will be deleted. Calling this is not required i.e. it will happen automatically when a Dali::BaseHandle is destroyed. .0

Definition at line 85 of file base-handle.cpp.

References mObjectHandle.

Referenced by Dali::Internal::Adaptor::Adaptor::DestroyTtsPlayer(), Dali::Toolkit::Internal::EmbossFilter::Disable(), Dali::Toolkit::Internal::BlurTwoPassFilter::Disable(), Dali::Toolkit::Internal::SpreadFilter::Disable(), Dali::Toolkit::Internal::ImageRenderer::DoInitialize(), Dali::Toolkit::Internal::NPatchRenderer::DoSetOffStage(), Dali::Toolkit::Internal::ImageRenderer::DoSetOffStage(), Dali::Toolkit::Internal::ItemView::EnableScrollOvershoot(), Dali::Toolkit::Internal::ItemView::GetNextKeyboardFocusableActor(), Dali::Toolkit::Internal::ScrollBar::HideIndicator(), Dali::Toolkit::Internal::Popup::LayoutTail(), Dali::Toolkit::Internal::Popup::OnAutoHideTimeReached(), Dali::Toolkit::Internal::Button::OnButtonStageDisconnection(), Dali::Toolkit::Internal::Button::OnButtonUp(), Dali::Internal::TouchEventProcessor::OnObservedActorDisconnected(), Dali::Toolkit::Internal::ScrollOvershootEffectRipple::OnOvershootAnimFinished(), Dali::Toolkit::Internal::ScrollBar::OnPan(), Dali::Toolkit::Internal::ScrollView::OnScrollAnimationFinished(), Dali::Toolkit::Internal::ScrollView::OnSnapInternalPositionFinished(), Dali::Toolkit::Internal::CubeTransitionEffect::OnStageDisconnection(), Dali::Internal::Adaptor::Application::OnTerminate(), Dali::Toolkit::Internal::Button::OnTouchPointLeave(), Dali::Internal::HoverEventProcessor::ProcessHoverEvent(), Dali::Internal::TouchEventProcessor::ProcessTouchEvent(), Dali::Toolkit::Internal::ScrollOvershootEffectRipple::Remove(), Dali::Toolkit::ControlRenderer::RemoveAndReset(), Dali::Toolkit::Internal::ItemView::RemoveAnimation(), Dali::Toolkit::Internal::Slider::RemovePopup(), Dali::TouchEventData::Reset(), Dali::Toolkit::Internal::CubeTransitionEffect::ResetToInitialState(), Dali::Toolkit::Internal::ImageView::SetImage(), Dali::Toolkit::Internal::NPatchRenderer::SetImage(), Dali::Toolkit::Internal::ImageRenderer::SetImage(), Dali::Toolkit::Internal::ScrollOvershootEffectRipple::SetOvershoot(), Dali::Toolkit::Internal::ScrollView::SetOvershootConstraintsEnabled(), Dali::Toolkit::Internal::PageTurnPortraitView::SetPanActor(), Dali::Toolkit::Internal::PageTurnLandscapeView::SetPanActor(), Dali::Toolkit::Internal::ScrollView::SetScrollUpdateNotification(), Dali::Toolkit::Internal::StyleManager::SetTheme(), Dali::Toolkit::Text::Decorator::Impl::SetupActiveLayerPropertyNotifications(), Dali::Internal::Stage::SetViewMode(), Dali::Toolkit::Internal::ScrollBar::ShowIndicator(), Dali::Toolkit::Internal::CubeTransitionEffect::StartTransition(), Dali::Toolkit::Internal::Popup::StartTransitionAnimation(), Dali::Internal::Adaptor::Adaptor::Stop(), Dali::Toolkit::Internal::ScrollView::StopAnimation(), Dali::Toolkit::Internal::Button::StopTransitionAnimation(), Dali::UnparentAndReset(), Dali::Toolkit::Internal::ScrollOvershootEffectRipple::UpdatePropertyNotifications(), UtcDaliAnimationPlayDiscardHandleP(), UtcDaliAnimationPlayStopDiscardHandleP(), UtcDaliCameraActorDownCastP(), UtcDaliCameraActorNewP(), UtcDaliCubeTransitionCrossEffectNew(), UtcDaliCubeTransitionFoldEffectNew(), UtcDaliCubeTransitionWaveEffectNew(), UtcDaliFrameBufferImageNew03(), UtcDaliHoverActorRemovedInSignal(), UtcDaliKeyInputFocusManagerSignalKeyInputFocusChanged(), UtcDaliLongPressGestureActorStagedAndDestroyed(), UtcDaliPanGestureActorStagedAndDestroyed(), UtcDaliPinchGestureActorStagedAndDestroyed(), UtcDaliShaderEffectMethodDelete01(), UtcDaliShaderEffectMethodSetEffectImageAndDelete(), UtcDaliTapGestureActorRemovedWhilePossible(), UtcDaliTapGestureSetTapsRequired(), UtcDaliTimerReset(), UtcDaliToolkitScrollBarScrollPositionIntervalReachedSignalN(), UtcDaliToolkitScrollBarScrollPositionIntervalReachedSignalP(), UtcDaliToolkitScrollBarSetScrollPositionIntervalsP(), UtcDaliTouchActorRemovedInSignal(), and Dali::Internal::Adaptor::Application::~Application().

void Dali::BaseHandle::ThisIsSaferThanReturningVoidStar ( ) const
inlineprotected

Used by the safe bool idiom.

.0

Definition at line 253 of file base-handle.h.

Referenced by operator BooleanType().

Here is the caller graph for this function:

Member Data Documentation

IntrusivePtr<Dali::RefObject> Dali::BaseHandle::mObjectHandle
private

Object this handle points at.

Definition at line 257 of file base-handle.h.

Referenced by GetObjectPtr(), operator BooleanType(), operator!=(), operator=(), operator==(), and Reset().


The documentation for this class was generated from the following files:
Dali Docs Home
Read more about Dali