Scarab  v2.11.1
Project 8 C++ Utility Library
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
TokenGroup Class Reference
Inheritance diagram for TokenGroup:
Inheritance graph

Public Member Functions

def __init__ (self, tu, memory, count)
 
def __del__ (self)
 

Static Public Member Functions

def get_tokens (tu, extent)
 

Private Attributes

 _tu
 
 _memory
 
 _count
 

Detailed Description

Helper class to facilitate token management.

Tokens are allocated from libclang in chunks. They must be disposed of as a
collective group.

One purpose of this class is for instances to represent groups of allocated
tokens. Each token in a group contains a reference back to an instance of
this class. When all tokens from a group are garbage collected, it allows
this class to be garbage collected. When this class is garbage collected,
it calls the libclang destructor which invalidates all tokens in the group.

You should not instantiate this class outside of this module.

Definition at line 423 of file cindex.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  tu,
  memory,
  count 
)

Definition at line 437 of file cindex.py.

◆ __del__()

def __del__ (   self)

Definition at line 442 of file cindex.py.

Member Function Documentation

◆ get_tokens()

def get_tokens (   tu,
  extent 
)
static
Helper method to return all tokens in an extent.

This functionality is needed multiple places in this module. We define
it here because it seems like a logical place.

Definition at line 446 of file cindex.py.

Member Data Documentation

◆ _count

_count
private

Definition at line 440 of file cindex.py.

◆ _memory

_memory
private

Definition at line 439 of file cindex.py.

◆ _tu

_tu
private

Definition at line 438 of file cindex.py.


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