wxWidgets: wxSharedClientDataContainer Class Reference

| Version: 3.2.6

Public Member Functions | List of all members
wxSharedClientDataContainer Class Reference
Class List by Category » Containers

`#include <wx/clntdata.h>`

Inheritance diagram for wxSharedClientDataContainer:
[legend]

## Detailed Description

This class is a replacement for wxClientDataContainer, and unlike wxClientDataContainer the wxSharedClientDataContainer client data is copiable, so it can be copied when objects containing it are cloned.

Like wxClientDataContainer, wxSharedClientDataContainer is a mixin that provides storage and management of "client data.". The client data is reference counted and managed by the container. As the client data is a shared object, changing the client data used by any object changes it for all other objects, too.

Note
  If your class has a Clone function and needs to store client data, use wxSharedClientDataContainer and not wxClientDataContainer!

##

Library: wxBase
Category: Containers

See also
  wxClientDataContainer, wxClientData

Since
  3.1.7

## Public Member Functions
void * | GetClientData () const
| Get the untyped client data. More...
wxClientData * | GetClientObject () const
| Get a pointer to the client data object. More...
void | SetClientData (void *data)
| Set the untyped client data. More...
void | SetClientObject (wxClientData *data)
| Set the client data object. More...

## Member Function Documentation

## ◆ GetClientData()

void* wxSharedClientDataContainer::GetClientData | ( |  | ) | const

Get the untyped client data.

## ◆ GetClientObject()

wxClientData* wxSharedClientDataContainer::GetClientObject | ( |  | ) | const

Get a pointer to the client data object.

## ◆ SetClientData()

void wxSharedClientDataContainer::SetClientData | ( | void * | data | ) |

Set the untyped client data.

## ◆ SetClientObject()

void wxSharedClientDataContainer::SetClientObject | ( | wxClientData * | data | ) |

Set the client data object.

Any previous object will be deleted.