Panda3D
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  */
18 get_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  */
28 get_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  */
37 get_num_entries() const {
38  return _catalog->get_num_entries();
39 }
40 
41 /**
42  * Returns the nth entry in the catalog.
43  */
45 get_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  */
55 find_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  */
66  return _catalog->find_entry_by_field(field);
67 }
68 
69 /**
70  * Returns the number of entries in the catalog.
71  */
72 INLINE int DCPackerCatalog::
73 get_num_entries() const {
74  return _entries.size();
75 }
76 
77 /**
78  * Returns the nth entry in the catalog.
79  */
81 get_entry(int n) const {
82  nassertr(n >= 0 && n < (int)_entries.size(), _entries[0]);
83  return _entries[n];
84 }
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...
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...
int get_num_entries() const
Returns the number of entries in the catalog.
int get_num_entries() const
Returns the number of entries 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...
const Entry & get_entry(int n) const
Returns the nth entry in the catalog.
size_t get_begin(int n) const
Returns the beginning of the indicated field within the live data.
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.