Skip to content

Commit

Permalink
Expose DatagramOutputFile to Python, add props to DatagramSink
Browse files Browse the repository at this point in the history
  • Loading branch information
rdb committed Sep 16, 2017
1 parent b8cb517 commit 35349b6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions panda/src/express/datagramSink.h
Expand Up @@ -40,6 +40,10 @@ class EXPCL_PANDAEXPRESS DatagramSink {
virtual const Filename &get_filename();
virtual const FileReference *get_file();
virtual streampos get_file_pos();

MAKE_PROPERTY(filename, get_filename);
MAKE_PROPERTY(file, get_file);
MAKE_PROPERTY(file_pos, get_file_pos);
};

#include "datagramSink.I"
Expand Down
9 changes: 7 additions & 2 deletions panda/src/putil/datagramOutputFile.h
Expand Up @@ -28,14 +28,13 @@
* header followed by a number of datagrams.
*/
class EXPCL_PANDA_PUTIL DatagramOutputFile : public DatagramSink {
public:
PUBLISHED:
INLINE DatagramOutputFile();
INLINE ~DatagramOutputFile();

bool open(const FileReference *file);
INLINE bool open(const Filename &filename);
bool open(ostream &out, const Filename &filename = Filename());
INLINE ostream &get_stream();

void close();

Expand All @@ -46,10 +45,16 @@ class EXPCL_PANDA_PUTIL DatagramOutputFile : public DatagramSink {
virtual bool is_error();
virtual void flush();

public:
virtual const Filename &get_filename();
virtual const FileReference *get_file();
virtual streampos get_file_pos();

INLINE ostream &get_stream();

PUBLISHED:
MAKE_PROPERTY(stream, get_stream);

private:
bool _wrote_first_datagram;
bool _error;
Expand Down

0 comments on commit 35349b6

Please sign in to comment.