34 bool erase(Uint16
id);
38 Uint16 getId(
unsigned i);
46 OpenFileItem(): m_file(NULL), m_id(0){};
57 inline AsyncFile* OpenFiles::find(Uint16
id)
const {
58 for (
unsigned i = 0;
i < m_files.size();
i++){
59 if (m_files[
i].m_id ==
id){
60 return m_files[
i].m_file;
67 inline bool OpenFiles::erase(Uint16
id){
68 for (
unsigned i = 0;
i < m_files.size();
i++){
69 if (m_files[
i].m_id ==
id){
82 for (
unsigned i = 0;
i < m_files.size();
i++){
83 if(m_files[
i].m_file == NULL)
86 if(strcmp(m_files[
i].m_file->theFileName.c_str(),
87 file->theFileName.c_str()) == 0)
90 names.
assfmt(
"open: >%s< existing: >%s<",
91 file->theFileName.c_str(),
92 m_files[
i].m_file->theFileName.c_str());
93 ERROR_SET(fatal, NDBD_EXIT_AFS_ALREADY_OPEN, names.
c_str(),
94 "OpenFiles::insert()");
99 OpenFileItem openFile;
101 openFile.m_file =
file;
102 m_files.push_back(openFile);
108 inline Uint16 OpenFiles::getId(
unsigned i){
109 return m_files[
i].m_id;
113 inline AsyncFile* OpenFiles::getFile(
unsigned i){
114 return m_files[
i].m_file;
118 inline unsigned OpenFiles::size(){
119 return m_files.size();