vil_nitf2.h
Go to the documentation of this file.
1 // vil_nitf2: Written by Rob Radtke (rob@) and Harry Voorhees (hlv@) of
2 // Stellar Science Ltd. Co. (stellarscience.com) for
3 // Air Force Research Laboratory, 2005.
4 
5 #ifndef VIL_NITF2_H
6 #define VIL_NITF2_H
7 
8 #include <vil/vil_stream.h>
9 
10 // These typedefs serve to maintain the method signatures' distinction between
11 // input and output streams, at least until we decide that such distinction is
12 // no longer useful.
15 
16 // Some of the integer values stored in nitf 2.x headers can be
17 // larger than 2^32. That's why we have vil_nitf2_long_long_formatter.
18 // We use this typedef so systems that don't have 64 bit integers
19 // can still use the class. Of course they will break if they try to
20 // read a header that contains a value greater than 2^32. Fortunately,
21 // that is somewhat rare.
22 #include <vxl_config.h>
23 #if VXL_HAS_INT_64
24 typedef vxl_int_64 vil_nitf2_long;
25 #else
26 typedef vxl_int_32 vil_nitf2_long;
27 #endif
28 
29 // Wrapper class for shared enums and static variables, to avoid circular
30 // dependencies among classes
31 //
32 class vil_nitf2
33 {
34  public:
35  // NITF field data types supported
41 
42  // Controls the level of detail of logging to std::cout.
43  // All errors are logged to std::cerr, irrespective of log level.
45 
46  // Logging level for all vil_nitf classes. This could be generalized to an
47  // array, if different subsets of classes want their own logging levels.
49  /**
50  * Call this function to flush all of the nitf2 classes statically
51  * allocated memory. Usually, you'd want to do this just before
52  * your application terminates or after you're done using vil_nitf2
53  * related classes. It's not a big deal if you call it too early (or often),
54  * the vil_nitf2 classes are smart enough to re-generate these members if
55  * they are needed later
56  */
57  static void cleanup_static_members();
58 };
59 
60 
61 
62 
63 #define VIL_NITF2_LOG(LEVEL) \
64  if (vil_nitf2::s_log_level < vil_nitf2::LEVEL) ; else std::cout
65 
66 #endif // VIL_NITF2_H
Stream interface for VIL image loaders.
vxl_int_32 vil_nitf2_long
Definition: vil_nitf2.h:26
vil_stream vil_nitf2_istream
Definition: vil_nitf2.h:13
Stream interface for VIL image loaders.
Definition: vil_stream.h:21
enum_field_type
Definition: vil_nitf2.h:36
vil_stream vil_nitf2_ostream
Definition: vil_nitf2.h:14
static enum_log_level s_log_level
Definition: vil_nitf2.h:48
static void cleanup_static_members()
Call this function to flush all of the nitf2 classes statically allocated memory.
Definition: vil_nitf2.cxx:14
enum_log_level
Definition: vil_nitf2.h:44