1 #ifndef BZS_DB_PROTOCOL_TDAP_CLIENT_MEMRECORD_H
2 #define BZS_DB_PROTOCOL_TDAP_CLIENT_MEMRECORD_H
36 class autoMemory :
public refarymem
41 autoMemory(
const autoMemory& p);
44 void setParams(
unsigned char* p,
size_t s,
short* endIndex,
bool own);
46 autoMemory& operator=(
const bzs::db::protocol::tdap::client::autoMemory& p);
47 void assignEndFieldIndex(
short* p);
52 static autoMemory* create(
int n);
53 static autoMemory* create();
58 #pragma warning(disable : 4251)
59 #pragma warning(disable : 4275)
60 #define ROW_MEM_BLOCK_RESERVE 4
62 #ifndef JOINLIMIT_PER_RECORD
63 #define JOINLIMIT_PER_RECORD 14
65 #if (JOINLIMIT_PER_RECORD < 1)
71 friend class multiRecordAlocatorImple;
72 friend class recordsetImple;
76 std::vector<autoMemory*> m_memblock;
78 autoMemory* m_memblock[JOINLIMIT_PER_RECORD];
81 mutable int m_blockIndexCache;
89 inline unsigned char* ptr(
int index)
const
91 return nullPtr(index) + (*m_fns)[index].nullbytes();
94 inline unsigned char* nullPtr(
int index)
const
96 return m_memblock[memoryBlockIndex(index)]->ptr;
99 inline int memoryBlockIndex(
int index)
const
101 for (
int i = 0; i < memBlockSize(); ++i)
102 if (*(m_memblock[i]->endFieldIndex) > index)
103 return m_blockIndexCache = i;
108 int memoryBlockIndexCache()
const {
return m_blockIndexCache;}
110 inline const autoMemory& memBlockByField(
int index)
const
112 return *m_memblock[memoryBlockIndex(index)];
115 inline const autoMemory& memBlock(
int index)
const
117 return *m_memblock[index];
120 inline int memBlockSize()
const {
return (
int)m_memblock.size(); }
122 inline int memBlockSize()
const {
return m_memblockSize; }
125 void removeLastMemBlock()
129 m_memblock[memBlockSize()-1]->release();
131 m_memblock.pop_back();
138 inline void setInvalidMemblockLast()
140 int num = memBlockSize() -1;
141 m_InvalidFlags |= ((2L << num) | 1L);
144 void releaseMemory();
147 inline memoryRecord();
148 inline memoryRecord(fielddefs& fdinfo);
149 memoryRecord(
const memoryRecord& r);
151 void copyToBuffer(table* tb,
bool updateOnly =
false)
const;
152 inline void copyFromBuffer(
const table* tb)
154 memcpy(nullPtr(0), tb->data(), m_fns->totalFieldLen());
156 void setRecordData(autoMemory* am,
unsigned char* ptr,
size_t size,
157 short* endFieldIndex,
bool owner =
false);
162 memoryRecord& operator=(
const memoryRecord& r);
163 static memoryRecord* create(fielddefs& fdinfo);
166 #pragma warning(default : 4275)
167 #pragma warning(default : 4251)
172 friend class activeTableImple;
184 void releaseMemory();
189 bool read(
bool KeysetAlrady =
false);
192 void del(
bool KeysetAlrady =
false,
bool noSeek =
false);
193 void update(
bool KeysetAlrady =
false,
bool noSeek =
false);
205 #endif // BZS_DB_PROTOCOL_TDAP_CLIENT_MEMRECORD_H
BOOKMARK構造体
Definition: tdapcapi.h:37
テーブルアクセスクラス (nocopyable)
Definition: table.h:91
fielddef のコレクションクラス
Definition: field.h:74
recordset フィルタリングクエリー
Definition: groupQuery.h:107
フィールドコレクションのベースクラス
Definition: fields.h:123
書き込み可能な行のクラスです。
Definition: memRecord.h:170
rowの実装クラス
Definition: memRecord.h:69