Panda3D

Classes | Public Member Functions | Friends | List of all members
DCPackerCatalog Class Reference

This object contains the names of all of the nested fields available within a particular field. More...

`#include "dcPackerCatalog.h"`

## Classes
class | Entry
class | LiveCatalog
class | LiveCatalogEntry

## Public Member Functions
int | find_entry_by_field (const DCPackerInterface *field) const
| Returns the index number of the entry with the indicated field, or -1 if no entry has the indicated field. More...
int | find_entry_by_name (const std::string &name) const
| Returns the index number of the entry with the indicated name, or -1 if no entry has the indicated name. More...
const Entry & | get_entry (int n) const
| Returns the nth entry in the catalog. More...
const LiveCatalog * | get_live_catalog (const char *data, size_t length) const
| Returns a LiveCatalog object indicating the positions within the indicated data record of each field within the catalog. More...
int | get_num_entries () const
| Returns the number of entries in the catalog. More...
void | release_live_catalog (const LiveCatalog *live_catalog) const
| Releases the LiveCatalog object that was returned by an earlier call to get_live_catalog(). More...

## Friends
class | DCPackerInterface

## Detailed Description

This object contains the names of all of the nested fields available within a particular field.

It is created on demand when a catalog is first requested from a particular field; its ownership is retained by the field so it must not be deleted.

Definition at line 29 of file dcPackerCatalog.h.

## Member Function Documentation

## ◆ find_entry_by_field()

int DCPackerCatalog::find_entry_by_field | ( | const DCPackerInterface * | field | ) | const

Returns the index number of the entry with the indicated field, or -1 if no entry has the indicated field.

The return value is suitable for passing to get_entry().

Definition at line 77 of file dcPackerCatalog.cxx.

## ◆ find_entry_by_name()

int DCPackerCatalog::find_entry_by_name | ( | const std::string & | name | ) | const

Returns the index number of the entry with the indicated name, or -1 if no entry has the indicated name.

The return value is suitable for passing to get_entry().

Definition at line 62 of file dcPackerCatalog.cxx.

Referenced by DCPackerInterface::find_seek_index().

## ◆ get_entry()

const DCPackerCatalog::Entry & DCPackerCatalog::get_entry | ( | int | n | ) | const
| inline

Returns the nth entry in the catalog.

Definition at line 80 of file dcPackerCatalog.I.

## ◆ get_live_catalog()

const DCPackerCatalog::LiveCatalog * DCPackerCatalog::get_live_catalog | ( | const char * | data,
|  | size_t | length
| ) |  | const

Returns a LiveCatalog object indicating the positions within the indicated data record of each field within the catalog.

If the catalog's fields are all fixed-width, this may return a statically-allocated LiveCatalog object that is the same for all data records; otherwise, it will allocate a new LiveCatalog object that must be freed with a later call to release_live_catalog().

Definition at line 95 of file dcPackerCatalog.cxx.

Referenced by DCPacker::seek().

## ◆ get_num_entries()

int DCPackerCatalog::get_num_entries | ( |  | ) | const
| inline

Returns the number of entries in the catalog.

Definition at line 72 of file dcPackerCatalog.I.

## ◆ release_live_catalog()

void DCPackerCatalog::release_live_catalog | ( | const LiveCatalog * | live_catalog | ) | const

Releases the LiveCatalog object that was returned by an earlier call to get_live_catalog().

If this represents a newly-allocated live catalog, it will free it; otherwise, it will do nothing.

It is therefore always correct (and necessary) to match a call to get_live_catalog() with a later call to release_live_catalog().

Definition at line 143 of file dcPackerCatalog.cxx.

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

- direct/src/dcparser/dcPackerCatalog.h
- direct/src/dcparser/dcPackerCatalog.cxx
- direct/src/dcparser/dcPackerCatalog.I