Panda3D
Loading...
Searching...
No Matches
typedWritable.I
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 typedWritable.I
10 * @author jason
11 * @date 2000-06-08
12 */
13
14/**
15 *
16 */
17INLINE TypedWritable::
18TypedWritable() : _bam_writers(nullptr) {
19}
20
21/**
22 *
23 */
24INLINE TypedWritable::
25TypedWritable(const TypedWritable &) : _bam_writers(nullptr) {
26}
27
28/**
29 *
30 */
31INLINE void TypedWritable::
32operator = (const TypedWritable &) {
33}
34
35/**
36 * Increments the bam_modified counter, so that this object will be
37 * invalidated and retransmitted on any open bam streams. This should
38 * normally not need to be called by user code; it should be called internally
39 * when the object has been changed in a way that legitimately requires its
40 * retransmission to any connected clients.
41 */
42INLINE void TypedWritable::
44 ++_bam_modified;
45}
46
47/**
48 * Returns the current bam_modified counter. This counter is normally
49 * incremented automatically whenever the object is modified.
50 */
52get_bam_modified() const {
53 return _bam_modified;
54}
55
56/**
57 * Converts the TypedWritable object into a single stream of data using a
58 * BamWriter, and returns that data as a bytes object. Returns an empty bytes
59 * object on failure.
60 *
61 * This is a convenience method particularly useful for cases when you are
62 * only serializing a single object. If you have many objects to process, it
63 * is more efficient to use the same BamWriter to serialize all of them
64 * together.
65 */
66INLINE vector_uchar TypedWritable::
68 vector_uchar data;
69 if (!encode_to_bam_stream(data)) {
70 data.clear();
71 }
72 return data;
73}
Base class for objects that can be written to and read from Bam files.
void mark_bam_modified()
Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any...
UpdateSeq get_bam_modified() const
Returns the current bam_modified counter.
vector_uchar encode_to_bam_stream() const
Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that da...
This is a sequence number that increments monotonically.
Definition updateSeq.h:37