14#ifndef DCPACKERCATALOG_H
15#define DCPACKERCATALOG_H
29class EXPCL_DIRECT_DCPARSER DCPackerCatalog {
31 DCPackerCatalog(
const DCPackerInterface *root);
32 DCPackerCatalog(
const DCPackerCatalog ©);
41 const DCPackerInterface *_field;
42 const DCPackerInterface *_parent;
57 INLINE
size_t get_end(
int n)
const;
65 typedef pvector<LiveCatalogEntry> LiveEntries;
66 LiveEntries _live_entries;
68 const DCPackerCatalog *_catalog;
69 friend class DCPackerCatalog;
81 void add_entry(
const std::string &name,
const DCPackerInterface *field,
82 const DCPackerInterface *parent,
int field_index);
84 void r_fill_catalog(
const std::string &name_prefix,
const DCPackerInterface *field,
85 const DCPackerInterface *parent,
int field_index);
90 const DCPackerInterface *switch_case)
const;
93 const DCPackerInterface *_root;
96 typedef pvector<Entry> Entries;
99 typedef pmap<std::string, int> EntriesByName;
100 EntriesByName _entries_by_name;
102 typedef pmap<const DCPackerInterface *, int> EntriesByField;
103 EntriesByField _entries_by_field;
105 typedef pmap<const DCPackerInterface *, DCPackerCatalog *> SwitchCatalogs;
106 SwitchCatalogs _switch_catalogs;
108 typedef pmap<const DCSwitchParameter *, std::string> SwitchPrefixes;
109 SwitchPrefixes _switch_prefixes;
111 friend class DCPackerInterface;
int get_num_entries() const
Returns the number of entries in the catalog.
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 f...
size_t get_begin(int n) const
Returns the beginning of the indicated field within the live data.
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 na...
const Entry & get_entry(int n) const
Returns the nth entry in the catalog.
size_t get_end(int n) const
Returns the end of the indicated field (the byte position of the first following field) within the li...
int get_num_entries() const
Returns the number of entries in the catalog.
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 na...
const Entry & get_entry(int n) const
Returns the nth entry in the catalog.
void release_live_catalog(const LiveCatalog *live_catalog) const
Releases the LiveCatalog object that was returned by an earlier call to get_live_catalog().
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 ...
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 f...
This defines the internal interface for packing values into a DCField.
This class can be used for packing a series of numeric and string data into a binary stream,...
This represents a switch object used as a parameter itself, which packs the appropriate fields of the...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.