-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dr.Abc
committed
Aug 19, 2023
1 parent
42ce439
commit b87250b
Showing
9 changed files
with
99 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#pragma once | ||
#include "CASBaseObject.h" | ||
#include "CASSQLItem.h" | ||
#include <vector> | ||
|
||
class CBinaryStringBuilder; | ||
class CASSQLGrid : public CASBaseGCObject{ | ||
public: | ||
//Only for c++ not expose to as | ||
CASSQLGrid(); | ||
~CASSQLGrid(); | ||
static CASSQLGrid* Factory(size_t row, size_t column); | ||
void Set(size_t row, size_t column, CASSQLItem* pItem); | ||
//Angel Scripts | ||
CASSQLItem* Get(size_t row, size_t column); | ||
CASSQLItem* opIndex(size_t row, size_t column); | ||
size_t Rows(); | ||
size_t Columns(); | ||
private: | ||
std::vector <std::vector<CASSQLItem*>> m_aryData; | ||
size_t m_iRow; | ||
size_t m_iColumn; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#include "CASBinaryStringBuilder.h" | ||
#include "CASSQLGrid.h" | ||
|
||
CASSQLGrid::CASSQLGrid(){ | ||
|
||
} | ||
|
||
CASSQLGrid::~CASSQLGrid(){ | ||
for (auto iter = m_aryData.begin(); iter != m_aryData.end(); iter++) { | ||
for (auto iter2 = (*iter).begin(); iter2 != (*iter).end(); iter2++) { | ||
(*iter2)->Release(); | ||
} | ||
(*iter).clear(); | ||
} | ||
m_aryData.clear(); | ||
} | ||
|
||
CASSQLGrid* CASSQLGrid::Factory(size_t row, size_t column){ | ||
CASSQLGrid* obj = new CASSQLGrid(); | ||
obj->m_aryData.resize(row); | ||
for (auto iter = obj->m_aryData.begin(); iter != obj->m_aryData.end(); iter++) { | ||
(*iter).resize(column); | ||
} | ||
obj->m_iRow = row; | ||
obj->m_iColumn = column; | ||
CASServerManager* manager = ASEXT_GetServerManager(); | ||
asIScriptEngine* engine = manager->scriptEngine; | ||
asITypeInfo* type = engine->GetTypeInfoByName("CSQLGrid"); | ||
engine->NotifyGarbageCollectorOfNewObject(obj, type); | ||
return obj; | ||
} | ||
|
||
void CASSQLGrid::Set(size_t row, size_t column, CASSQLItem* pItem){ | ||
m_aryData[row][column] = pItem; | ||
} | ||
|
||
CASSQLItem* CASSQLGrid::Get(size_t row, size_t column){ | ||
if (row >= m_iRow || column >= m_iColumn) | ||
return nullptr; | ||
return m_aryData[row][column]; | ||
} | ||
CASSQLItem* CASSQLGrid::opIndex(size_t row, size_t column){ | ||
return Get(row, column); | ||
} | ||
size_t CASSQLGrid::Rows(){ | ||
return m_iRow; | ||
} | ||
size_t CASSQLGrid::Columns(){ | ||
return m_iColumn; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters