• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kdecore
 

kdecore

Public Member Functions | List of all members
KShared Class Reference

#include <ksharedptr.h>

Inheritance diagram for KShared:
KLockFile KMountPoint KSharedConfig KSycocaEntry KTimezoneSource

Public Member Functions

 KShared ()
 
 KShared (const KShared &)
 
KShared & operator= (const KShared &)
 
void _KShared_ref () const
 
void _KShared_unref () const
 
int _KShared_count () const
 

Detailed Description

Reference counting for shared objects.

If you derive your object from this class, then you may use it in conjunction with KSharedPtr to control the lifetime of your object.

Specifically, all classes that derive from KShared have an internal counter keeping track of how many other objects have a reference to their object. If used with KSharedPtr, then your object will not be deleted until all references to the object have been released.

You should probably not ever use any of the methods in this class directly – let the KSharedPtr take care of that. Just derive your class from KShared and forget about it.

Author
Waldo Bastian basti.nosp@m.an@k.nosp@m.de.or.nosp@m.g

Definition at line 40 of file ksharedptr.h.

Constructor & Destructor Documentation

◆ KShared() [1/2]

KShared::KShared ( )
inline

Standard constructor.

This will initialize the reference count on this object to 0.

Definition at line 46 of file ksharedptr.h.

◆ KShared() [2/2]

KShared::KShared ( const KShared &  )
inline

Copy constructor.

This will not actually copy the objects but it will initialize the reference count on this object to 0.

Definition at line 52 of file ksharedptr.h.

Member Function Documentation

◆ _KShared_count()

int KShared::_KShared_count ( ) const
inline

Return the current number of references held.

Returns
Number of references

Definition at line 75 of file ksharedptr.h.

◆ _KShared_ref()

void KShared::_KShared_ref ( ) const
inline

Increases the reference count by one.

Definition at line 62 of file ksharedptr.h.

◆ _KShared_unref()

void KShared::_KShared_unref ( ) const
inline

Releases a reference (decreases the reference count by one).

If the count goes to 0, this object will delete itself.

Definition at line 68 of file ksharedptr.h.

◆ operator=()

KShared& KShared::operator= ( const KShared &  )
inline

Overloaded assignment operator.

Definition at line 57 of file ksharedptr.h.


The documentation for this class was generated from the following file:
  • ksharedptr.h

kdecore

Skip menu "kdecore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdecore

Skip menu "kdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdecore by doxygen 1.8.13
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |