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