Panda3D
Loading...
Searching...
No Matches
dcPackerCatalog.I
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file dcPackerCatalog.I
10 * @author drose
11 * @date 2004-06-21
12 */
13
14/**
15 * Returns the beginning of the indicated field within the live data.
16 */
18get_begin(int n) const {
19 nassertr(n >= 0 && n < (int)_live_entries.size(), 0);
20 return _live_entries[n]._begin;
21}
22
23/**
24 * Returns the end of the indicated field (the byte position of the first
25 * following field) within the live data.
26 */
28get_end(int n) const {
29 nassertr(n >= 0 && n < (int)_live_entries.size(), 0);
30 return _live_entries[n]._end;
31}
32
33/**
34 * Returns the number of entries in the catalog.
35 */
37get_num_entries() const {
38 return _catalog->get_num_entries();
39}
40
41/**
42 * Returns the nth entry in the catalog.
43 */
45get_entry(int n) const {
46 return _catalog->get_entry(n);
47}
48
49/**
50 * Returns the index number of the entry with the indicated name, or -1 if no
51 * entry has the indicated name. The return value is suitable for passing to
52 * get_entry().
53 */
55find_entry_by_name(const std::string &name) const {
56 return _catalog->find_entry_by_name(name);
57}
58
59/**
60 * Returns the index number of the entry with the indicated field, or -1 if no
61 * entry has the indicated field. The return value is suitable for passing to
62 * get_entry().
63 */
65find_entry_by_field(const DCPackerInterface *field) const {
66 return _catalog->find_entry_by_field(field);
67}
68
69/**
70 * Returns the number of entries in the catalog.
71 */
73get_num_entries() const {
74 return _entries.size();
75}
76
77/**
78 * Returns the nth entry in the catalog.
79 */
81get_entry(int n) const {
82 nassertr(n >= 0 && n < (int)_entries.size(), _entries[0]);
83 return _entries[n];
84}
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.
const Entry & get_entry(int n) const
Returns the nth entry in the catalog.
This defines the internal interface for packing values into a DCField.