00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 INLINE size_t BufferContext::
00026 get_data_size_bytes() const {
00027 return _data_size_bytes;
00028 }
00029
00030
00031
00032
00033
00034
00035
00036 INLINE UpdateSeq BufferContext::
00037 get_modified() const {
00038 return _modified;
00039 }
00040
00041
00042
00043
00044
00045
00046
00047
00048 INLINE bool BufferContext::
00049 get_active() const {
00050 return (_residency_state & BufferResidencyTracker::S_active) != 0;
00051 }
00052
00053
00054
00055
00056
00057
00058
00059
00060 INLINE bool BufferContext::
00061 get_resident() const {
00062 return (_residency_state & BufferResidencyTracker::S_resident) != 0;
00063 }
00064
00065
00066
00067
00068
00069
00070
00071
00072 INLINE void BufferContext::
00073 set_active(bool flag) {
00074 if (flag) {
00075 _residency_state |= BufferResidencyTracker::S_active;
00076
00077
00078 _residency_state |= BufferResidencyTracker::S_resident;
00079 } else {
00080 _residency_state &= ~BufferResidencyTracker::S_active;
00081 }
00082 set_owning_chain(&_residency->_chains[_residency_state]);
00083 }
00084
00085
00086
00087
00088
00089
00090
00091
00092 INLINE void BufferContext::
00093 set_resident(bool flag) {
00094 if (flag) {
00095 _residency_state |= BufferResidencyTracker::S_resident;
00096 } else {
00097 _residency_state &= ~BufferResidencyTracker::S_resident;
00098 }
00099 set_owning_chain(&_residency->_chains[_residency_state]);
00100 }
00101
00102
00103
00104
00105
00106
00107
00108
00109 INLINE BufferContext *BufferContext::
00110 get_next() const {
00111 nassertr(_owning_chain != (BufferContextChain *)NULL, NULL);
00112 if ((BufferContextChain *)_next == _owning_chain) {
00113 return NULL;
00114 }
00115 return (BufferContext *)_next;
00116 }
00117
00118
00119
00120
00121
00122
00123
00124 INLINE void BufferContext::
00125 update_data_size_bytes(size_t new_data_size_bytes) {
00126 if (_owning_chain != (BufferContextChain *)NULL) {
00127 _owning_chain->adjust_bytes((int)new_data_size_bytes - (int)_data_size_bytes);
00128 }
00129 _data_size_bytes = new_data_size_bytes;
00130 }
00131
00132
00133
00134
00135
00136
00137
00138 INLINE void BufferContext::
00139 update_modified(UpdateSeq new_modified) {
00140 _modified = new_modified;
00141 }