Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::RingServiceIdZone Class Reference

#include <service.h>

Inheritance diagram for dart::RingServiceIdZone:
dart::ServiceIdZone

Public Member Functions

 RingServiceIdZone ()
 
virtual ~RingServiceIdZone ()
 
void Init (ObjectIdRing *ring, ObjectIdRing::IdPolicy policy)
 
virtual char * GetServiceId (const Object &obj)
 
void set_policy (ObjectIdRing::IdPolicy policy)
 
ObjectIdRing::IdPolicy policy () const
 
- Public Member Functions inherited from dart::ServiceIdZone
 ServiceIdZone ()
 
virtual ~ServiceIdZone ()
 
virtual char * GetServiceId (const Object &obj)=0
 

Detailed Description

Definition at line 53 of file service.h.

Constructor & Destructor Documentation

◆ RingServiceIdZone()

dart::RingServiceIdZone::RingServiceIdZone ( )

Definition at line 369 of file service.cc.

370 : ring_(nullptr), policy_(ObjectIdRing::kAllocateId) {}

◆ ~RingServiceIdZone()

dart::RingServiceIdZone::~RingServiceIdZone ( )
virtual

Definition at line 372 of file service.cc.

372{}

Member Function Documentation

◆ GetServiceId()

char * dart::RingServiceIdZone::GetServiceId ( const Object obj)
virtual

Implements dart::ServiceIdZone.

Definition at line 380 of file service.cc.

380 {
381 ASSERT(ring_ != nullptr);
382 Thread* thread = Thread::Current();
383 Zone* zone = thread->zone();
384 ASSERT(zone != nullptr);
385 const intptr_t id = ring_->GetIdForObject(obj.ptr(), policy_);
386 return zone->PrintToString("objects/%" Pd "", id);
387}
int32_t GetIdForObject(ObjectPtr raw_obj, IdPolicy policy=kAllocateId)
static Thread * Current()
Definition: thread.h:362
#define ASSERT(E)
#define Pd
Definition: globals.h:408

◆ Init()

void dart::RingServiceIdZone::Init ( ObjectIdRing ring,
ObjectIdRing::IdPolicy  policy 
)

Definition at line 374 of file service.cc.

375 {
376 ring_ = ring;
377 policy_ = policy;
378}
ObjectIdRing::IdPolicy policy() const
Definition: service.h:65

◆ policy()

ObjectIdRing::IdPolicy dart::RingServiceIdZone::policy ( ) const
inline

Definition at line 65 of file service.h.

65{ return policy_; }

◆ set_policy()

void dart::RingServiceIdZone::set_policy ( ObjectIdRing::IdPolicy  policy)
inline

Definition at line 63 of file service.h.

63{ policy_ = policy; }

The documentation for this class was generated from the following files: