MrSID Decode SDK for LiDAR Reference Manual  1.1.4.4709
IO.h
Go to the documentation of this file.
1 /* //////////////////////////////////////////////////////////////////////////
2 // //
3 // This code is Copyright (c) 2008-2010 LizardTech, Inc, 1008 Western //
4 // Avenue, Suite 200, Seattle, WA 98104. Unauthorized use or distribution //
5 // prohibited. Access to and use of this code is permitted only under //
6 // license from LizardTech, Inc. Portions of the code are protected by //
7 // US and foreign patents and other filings. All Rights Reserved. //
8 // //
10 /* PUBLIC */
11 
12 #ifndef __LIDAR_IO_H__
13 #define __LIDAR_IO_H__
14 
15 #include "lidar/Object.h"
16 
17 LT_BEGIN_LIDAR_NAMESPACE
18 
29 class IO : public Object
30 {
31  ABSTRACT_OBJECT(IO);
32 public:
37 
59  virtual void open(void) = 0;
81  virtual void close(void) = 0;
82 
93  virtual size_t pread(offset_type offset,
94  void *buffer,
95  size_t nbytes) const = 0;
106  virtual size_t pwrite(offset_type offset,
107  const void *buffer,
108  size_t nbytes) const = 0;
109 
115  virtual offset_type size(void) const = 0;
116 
126  virtual void truncate(offset_type length) = 0;
127 
133  virtual void unlink(void) = 0;
134 
135 
140  struct Location
141  {
142  IO *io;
143  offset_type offset;
144  offset_type length;
145 
146  ~Location(void);
147 
148  Location(IO *io = NULL, offset_type offset = 0, offset_type length = 0);
149  Location(const Location &rhs);
150  Location &operator=(const Location &rhs);
151 
152  void set(IO *io, offset_type offset, offset_type length);
153  };
154 };
155 
156 LT_END_LIDAR_NAMESPACE
157 #endif // __LIDAR_IO_H__
Location(IO *io=NULL, offset_type offset=0, offset_type length=0)
offset_type length
Definition: IO.h:144
lt_int64 offset_type
Integer data type for file offsets and sizes.
Definition: IO.h:36
IO is the base class for binary input and output.
Definition: IO.h:29
virtual size_t pwrite(offset_type offset, const void *buffer, size_t nbytes) const =0
Write data.
offset_type offset
Definition: IO.h:143
virtual void close(void)=0
Close the IO object.
virtual size_t pread(offset_type offset, void *buffer, size_t nbytes) const =0
Read data.
virtual void truncate(offset_type length)=0
Set the size of the resource.
virtual offset_type size(void) const =0
Get the size of the resource.
Location & operator=(const Location &rhs)
IO * io
Definition: IO.h:142
Location is a helper structure for holding the location of data in a IO object.
Definition: IO.h:140
long long int lt_int64
signed 64-bit integer
Definition: Base.h:46
Object is the base class for implementing reference counting.
Definition: Object.h:34
virtual void open(void)=0
Open the IO object.
virtual void unlink(void)=0
Delete the resource when the IO object is deleted.

LizardTech