Panda3D
bamEnums.h
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 bamEnums.h
10  * @author drose
11  * @date 2009-02-26
12  */
13 
14 #ifndef BAMENUMS_H
15 #define BAMENUMS_H
16 
17 #include "pandabase.h"
18 
19 /**
20  * This class exists just to provide scoping for the enums shared by BamReader
21  * and BamWriter.
22  */
23 class EXPCL_PANDA_PUTIL BamEnums {
24 PUBLISHED:
25 
26  // This defines an enumerated type used to represent the endianness of
27  // certain numeric values stored in a Bam file. It really has only two
28  // possible values, either BE_bigendian or BE_littleendian; but through a
29  // preprocessor trick we also add BE_native, which is the same numerically
30  // as whichever value the hardware supports natively.
31  enum BamEndian {
32  BE_bigendian = 0,
33  BE_littleendian = 1,
34 #ifdef WORDS_BIGENDIAN
35  BE_native = 0,
36 #else
37  BE_native = 1,
38 #endif
39  };
40 
41 /*
42  * This is the code written along with each object. It is used to control
43  * object scoping. A BOC_push includes an object definition, and will always
44  * be eventually paired with a BOC_pop (which does not). A BOC_adjunct
45  * includes an object definition but does not push the level; it is associated
46  * with the current level. BOC_remove lists object ID's that have been
47  * deallocated on the sender end. BOC_file_data may appear at any level and
48  * indicates the following datagram contains auxiliary file data that may be
49  * referenced by a later object.
50  */
51  enum BamObjectCode {
52  BOC_push,
53  BOC_pop,
54  BOC_adjunct,
55  BOC_remove,
56  BOC_file_data,
57  };
58 
59  // This enum is used to control how textures are written to a bam stream.
60  enum BamTextureMode {
61  BTM_unchanged,
62  BTM_fullpath,
63  BTM_relative,
64  BTM_basename,
65  BTM_rawdata
66  };
67 };
68 
69 EXPCL_PANDA_PUTIL std::ostream &operator << (std::ostream &out, BamEnums::BamEndian be);
70 EXPCL_PANDA_PUTIL std::istream &operator >> (std::istream &in, BamEnums::BamEndian &be);
71 
72 EXPCL_PANDA_PUTIL std::ostream &operator << (std::ostream &out, BamEnums::BamObjectCode boc);
73 
74 EXPCL_PANDA_PUTIL std::ostream &operator << (std::ostream &out, BamEnums::BamTextureMode btm);
75 EXPCL_PANDA_PUTIL std::istream &operator >> (std::istream &in, BamEnums::BamTextureMode &btm);
76 
77 #endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class exists just to provide scoping for the enums shared by BamReader and BamWriter.
Definition: bamEnums.h:23