V8  latest master commit
V8 is Google's open source JavaScript engine
cppgc::GarbageCollectedMixin Class Reference

#include <garbage-collected.h>

Inheritance diagram for cppgc::GarbageCollectedMixin:
cppgc::internal::GarbageCollectedBase

Public Types

using IsGarbageCollectedMixinTypeMarker = void
 

Public Member Functions

virtual TraceDescriptor GetTraceDescriptor () const
 
virtual void Trace (cppgc::Visitor *) const
 
- Public Member Functions inherited from cppgc::internal::GarbageCollectedBase
void * operator new (size_t)=delete
 
void * operator new[] (size_t)=delete
 
void operator delete (void *)
 
void operator delete[] (void *)=delete
 

Static Public Attributes

static constexpr void * kNotFullyConstructedObject = nullptr
 

Additional Inherited Members

- Protected Member Functions inherited from cppgc::internal::GarbageCollectedBase
 GarbageCollectedBase ()=default
 

Detailed Description

Base class for managed mixin objects. Such objects cannot be constructed directly but must be mixed into the inheritance hierarchy of a GarbageCollected object.

Types inheriting from GarbageCollectedMixin must override a virtual method of signature void Trace(cppgc::Visitor*) const that dispatchs all managed pointers to the visitor and delegates to base classes.

class Mixin : public GarbageCollectedMixin {
public:
void Trace(cppgc::Visitor* visitor) const override {
// Dispatch using visitor->Trace(...);
}
};

Definition at line 103 of file garbage-collected.h.

Member Typedef Documentation

◆ IsGarbageCollectedMixinTypeMarker

Member Function Documentation

◆ GetTraceDescriptor()

virtual TraceDescriptor cppgc::GarbageCollectedMixin::GetTraceDescriptor ( ) const
inlinevirtual

Definition at line 113 of file garbage-collected.h.

◆ Trace()

virtual void cppgc::GarbageCollectedMixin::Trace ( cppgc::Visitor ) const
inlinevirtual

This Trace method must be overriden by objects inheriting from GarbageCollectedMixin.

Definition at line 121 of file garbage-collected.h.

Field Documentation

◆ kNotFullyConstructedObject

constexpr void* cppgc::GarbageCollectedMixin::kNotFullyConstructedObject = nullptr
staticconstexpr

Definition at line 108 of file garbage-collected.h.


The documentation for this class was generated from the following file:
cppgc::GarbageCollectedMixin::Trace
virtual void Trace(cppgc::Visitor *) const
Definition: garbage-collected.h:121
cppgc::Visitor
Definition: visitor.h:27