Page Speed Optimization Libraries  1.5.27.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Member Functions
net_instaweb::ManuallyRefCounted Class Reference

#include "manually_ref_counted.h"

Inheritance diagram for net_instaweb::ManuallyRefCounted:
net_instaweb::FileLoadMapping net_instaweb::FileLoadRule net_instaweb::FileLoadMappingLiteral net_instaweb::FileLoadMappingRegexp net_instaweb::FileLoadRuleLiteral net_instaweb::FileLoadRuleRegexp

List of all members.

Public Member Functions

void IncrementRefs ()
void DecrementRefs ()

Protected Member Functions

virtual ~ManuallyRefCounted ()

Detailed Description

Class that assists with manual reference counting. Other classes should inherit from this one, and users of those classes should call IncrementRefs when making copies and DecrementRefs when they finish with those copies.


Constructor & Destructor Documentation

virtual net_instaweb::ManuallyRefCounted::~ManuallyRefCounted ( ) [inline, protected, virtual]

The destructor isn't public because instances of ManuallyRefCounted subclasses should not be directly deleted. They should be released via DecrementRefs().


Member Function Documentation

Call this when finished with a pointer to a subclass instance: class ExampleHolder { Example* e; ~ExampleHolder() { if (e != NULL) { If e is the last pointer to *e then *e will be deleted. e->DecrementRefs(); } } }

Call this when duplicating a pointer to subclass instances: Example* e = other->GetExample(); e->IncrementRefs();


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines