Changeset 1500:872b0b69e0d5
- Timestamp:
- 05/14/11 23:07:44 (9 months ago)
- Branch:
- default
- Tags:
- tip
- Location:
- sources
- Files:
-
- 1 added
- 25 edited
-
configure (modified) (3 diffs)
-
configure.in (modified) (1 diff)
-
examples/io_network.pc_thread/test.cc (modified) (1 diff)
-
examples/pc_workqueue/test.cc (modified) (1 diff)
-
include/libdodo/cgiDialogue.h (modified) (1 diff)
-
include/libdodo/dataBasePostgresql.h (modified) (1 diff)
-
include/libdodo/dataBaseSqlite.h (modified) (1 diff)
-
include/libdodo/list.h (added)
-
include/libdodo/pcExecutionManager.h (modified) (1 diff)
-
include/libdodo/pcExecutionWorkqueue.h (modified) (1 diff)
-
include/libdodo/toolsLogger.h (modified) (1 diff)
-
include/libdodo/types.h (modified) (2 diffs)
-
include/libdodo/xexec.h (modified) (3 diffs)
-
src/cgiDialogue.cc (modified) (2 diffs)
-
src/dataBaseMysql.cc (modified) (2 diffs)
-
src/dataBasePostgresql.cc (modified) (8 diffs)
-
src/dataBaseSqlConstructor.cc (modified) (2 diffs)
-
src/dataBaseSqlite.cc (modified) (9 diffs)
-
src/dataTplProcessor.cc (modified) (1 diff)
-
src/pcExecutionManager.cc (modified) (1 diff)
-
src/pcExecutionWorkqueue.cc (modified) (8 diffs)
-
src/toolsLogger.cc (modified) (3 diffs)
-
src/toolsMisc.cc (modified) (1 diff)
-
src/toolsRegexp.cc (modified) (1 diff)
-
src/types.cc (modified) (1 diff)
-
src/xexec.cc (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sources/configure
r1499 r1500 674 674 enable_profiling 675 675 enable_libwrap 676 enable_deque677 676 enable_io_xexec 678 677 enable_database_xexec … … 1324 1323 --enable-profiling enable profiling 1325 1324 --disable-libwrap disable libwrap support 1326 --disable-deque use std::vector instead of std::deque1327 1325 --disable-io-xexec compile io:: w/o xexec support 1328 1326 --disable-database-xexec … … 4893 4891 fi 4894 4892 4895 # Check whether --enable-deque was given.4896 if test "${enable_deque+set}" = set; then :4897 enableval=$enable_deque; DEQUE="$enableval"4898 else4899 DEQUE="yes"4900 fi4901 4902 if test "$DEQUE" = "yes"4903 then4904 echo -n -e "#define USE_DEQUE 1\n\n" >> include/libdodo/directives.runtime.h4905 4906 RESULT="$RESULT\nDeque\t\t\t\t\t\t\t\tenabled"4907 else4908 RESULT="$RESULT\nDeque\t\t\t\t\t\t\t\tdisabled"4909 fi4910 4911 4893 # Check whether --enable-io-xexec was given. 4912 4894 if test "${enable_io_xexec+set}" = set; then : -
sources/configure.in
r1499 r1500 136 136 else 137 137 RESULT="$RESULT\nlibwrap\t\t\t\t\t\t\t\tdisabled" 138 fi139 140 AC_ARG_ENABLE(deque,141 AS_HELP_STRING([--disable-deque], [use std::vector instead of std::deque]),142 [DEQUE="$enableval"], [DEQUE="yes"])143 if test "$DEQUE" = "yes"144 then145 echo -n -e "#define USE_DEQUE 1\n\n" >> include/libdodo/directives.runtime.h146 147 RESULT="$RESULT\nDeque\t\t\t\t\t\t\t\tenabled"148 else149 RESULT="$RESULT\nDeque\t\t\t\t\t\t\t\tdisabled"150 138 fi 151 139 -
sources/examples/io_network.pc_thread/test.cc
r1493 r1500 111 111 112 112 dodo_try { 113 dodo List<unsigned long> threads = manager.jobs();114 dodo List<unsigned long>::iterator i = threads.begin(), j = threads.end();113 dodo::slList<unsigned long> threads = manager.jobs(); 114 dodo::slList<unsigned long>::iterator i = threads.begin(), j = threads.end(); 115 115 for (; i != j; ++i) 116 116 if (manager.isRunning(*i)) { -
sources/examples/pc_workqueue/test.cc
r1493 r1500 49 49 wq.add(work, (void *)"last"); 50 50 51 tools::os::sleep( 20);51 tools::os::sleep(30); 52 52 } dodo_catch (dodo::exception::basic *e) { 53 53 cout << (dodo::string)*e << "\t" << e->line << "\t" << e->file << endl; -
sources/include/libdodo/cgiDialogue.h
r1439 r1500 262 262 dodo::string postFilesTmpDir; ///< directory for POST files if on they are saved on the disk 263 263 264 dodo List<cookie> cookies; ///< cookies264 dodo::slList<cookie> cookies; ///< cookies 265 265 int requestMethod; ///< request method 266 266 -
sources/include/libdodo/dataBasePostgresql.h
r1439 r1500 250 250 }; 251 251 252 dodo List<__blob__> blobs; ///< references to blob data252 dodo::slList<__blob__> blobs; ///< references to blob data 253 253 254 254 private: -
sources/include/libdodo/dataBaseSqlite.h
r1439 r1500 172 172 }; 173 173 174 dodo List<__blob__> blobs; ///< references to blob data174 dodo::slList<__blob__> blobs; ///< references to blob data 175 175 176 176 private: -
sources/include/libdodo/pcExecutionManager.h
r1439 r1500 119 119 * @return list of jobs in object 120 120 */ 121 dodo List<unsigned long> jobs();121 dodo::slList<unsigned long> jobs(); 122 122 123 123 /** -
sources/include/libdodo/pcExecutionWorkqueue.h
r1482 r1500 89 89 90 90 struct __work__; 91 dodoList<__work__ *> tasks; ///< pending work92 91 93 dodoList<execution::thread *> active; ///< active thread 94 dodoList<execution::thread *> inactive; ///< inactive thread 92 dodo::dlList<__work__ *> tasks; ///< pending work 93 94 dodo::dlList<execution::thread *> active; ///< active thread 95 dodo::dlList<execution::thread *> inactive; ///< inactive thread 95 96 96 97 unsigned int maxThreads; ///< max amount of active threads -
sources/include/libdodo/toolsLogger.h
r1439 r1500 128 128 }; 129 129 130 dodo List<__log_map__> handlers; ///< list of log maps130 dodo::slList<__log_map__> handlers; ///< list of log maps 131 131 132 132 unsigned long handlersNum; ///< number of registered handlers -
sources/include/libdodo/types.h
r1464 r1500 33 33 #include <libdodo/directives.h> 34 34 #include <libdodo/string.h> 35 #include <libdodo/list.h> 35 36 36 37 #include <vector> 37 #include <list>38 38 #include <deque> 39 39 #include <map> 40 #include <cstddef> 41 42 #ifndef NULL 43 #define NULL ((void *)0) 44 #endif 40 45 41 46 namespace dodo { … … 143 148 #define dodoMap std::map 144 149 145 #ifdef USE_DEQUE146 #define dodoArray std::deque147 #else148 150 #define dodoArray std::vector 149 #endif150 151 151 152 typedef dodoArray<dodo::string> dodoStringArray; ///< array of strings 152 153 153 #define dodoList std::list 154 155 typedef dodoList<dodo::string> dodoStringList; ///< array of strings 154 typedef dodo::slList<dodo::string> dodoStringList; ///< array of strings 156 155 157 156 typedef dodoMap<dodo::string, dodo::string, dodoMapStringCompare> dodoStringMap; ///< hash of strings -
sources/include/libdodo/xexec.h
r1439 r1500 257 257 * @param id defines XExec identificator 258 258 */ 259 bool getXexec(dodo List<__item__> &list,259 bool getXexec(dodo::slList<__item__> &list, 260 260 int id); 261 261 … … 267 267 * @param data defines hook data 268 268 */ 269 int addXExec(dodo List<__item__> &list,269 int addXExec(dodo::slList<__item__> &list, 270 270 hook func, 271 271 void *data); … … 276 276 * @param operation defines what operation initiated the hook 277 277 */ 278 void performXExec(dodo List<__item__> &list,278 void performXExec(dodo::slList<__item__> &list, 279 279 short operation) const; 280 280 281 mutable dodo List<__item__> preExec; ///< preExec hooks282 mutable dodo List<__item__> postExec; ///< postExec hooks281 mutable dodo::slList<__item__> preExec; ///< preExec hooks 282 mutable dodo::slList<__item__> postExec; ///< postExec hooks 283 283 284 284 int execs; ///< hook counter 285 285 286 dodo List<__item__>::iterator current; ///< iterator for list[for matched with getXexec method]286 dodo::slList<__item__>::iterator current; ///< iterator for list[for matched with getXexec method] 287 287 288 288 short execObject; ///< type of object, @see xexec::objectEnum -
sources/src/cgiDialogue.cc
r1497 r1500 574 574 575 575 if (cookies.size() > 0) { 576 dodo List<cookie>::const_iterator i(cookies.begin()), j(cookies.end());576 dodo::slList<cookie>::iterator i(cookies.begin()), j(cookies.end()); 577 577 for (; i != j; ++i) { 578 578 io.writeString("Set-Cookie: "); … … 818 818 dialogue::setCookie(const cookie &cookie) 819 819 { 820 cookies.push _back(cookie);821 } 822 823 //------------------------------------------------------------------- 824 820 cookies.push(cookie); 821 } 822 823 //------------------------------------------------------------------- 824 -
sources/src/dataBaseMysql.cc
r1464 r1500 280 280 MYSQL_FIELD *mysqlFields = mysql_fetch_fields(handle->result); 281 281 282 #ifndef USE_DEQUE283 282 rows->fields.reserve(numFields); 284 283 285 284 rows->values.reserve(mysql_num_rows(handle->result)); 286 #endif287 285 288 286 unsigned long *length, j; … … 292 290 MYSQL_ROW mysqlRow; 293 291 294 #ifndef USE_DEQUE295 292 values.reserve(numFields); 296 #endif297 293 298 294 for (unsigned int i(0); i < numFields; ++i) -
sources/src/dataBasePostgresql.cc
r1464 r1500 279 279 int fieldsNum = PQnfields(handle->result); 280 280 281 #ifndef USE_DEQUE282 281 rows->fields.reserve(fieldsNum); 283 282 rows->values.reserve(rowsNum); 284 #endif285 283 286 284 dodoStringArray values; 287 285 288 #ifndef USE_DEQUE289 286 values.reserve(fieldsNum); 290 #endif291 287 292 288 for (int i(0); i < fieldsNum; ++i) … … 453 449 int *formats = new int[size]; 454 450 455 dodo List<__blob__>::iterator i(blobs.begin()), j(blobs.end());451 dodo::slList<__blob__>::iterator i(blobs.begin()), j(blobs.end()); 456 452 for (int o = 0; i != j; ++i, ++o) { 457 453 values[o] = (char *)i->value->data(); … … 560 556 blob.value = &(*j); 561 557 562 blobs.push _back(blob);558 blobs.push(blob); 563 559 } else { 564 560 request += dodo::string(statements[sql::constructor::STATEMENT_EQUAL]); … … 590 586 blob.value = &(*j); 591 587 592 blobs.push _back(blob);588 blobs.push(blob); 593 589 } else { 594 590 request += dodo::string(statements[sql::constructor::STATEMENT_EQUAL]); … … 670 666 blob.value = &(*i); 671 667 672 blobs.push _back(blob);668 blobs.push(blob); 673 669 } else 674 670 request += dodo::string(*i + statements[sql::constructor::STATEMENT_COMA]); … … 690 686 blob.value = &(*i); 691 687 692 blobs.push _back(blob);688 blobs.push(blob); 693 689 } else 694 690 request += dodo::string(*i); … … 719 715 blob.value = &(*i); 720 716 721 blobs.push _back(blob);717 blobs.push(blob); 722 718 } else 723 719 request += dodo::string(*i + statements[sql::constructor::STATEMENT_COMA]); … … 739 735 blob.value = &(*i); 740 736 741 blobs.push _back(blob);737 blobs.push(blob); 742 738 } else 743 739 request += dodo::string(*i); -
sources/src/dataBaseSqlConstructor.cc
r1456 r1500 202 202 203 203 dodoStringArray array; 204 #ifndef USE_DEQUE205 204 array.reserve(i->size()); 206 #endif207 205 208 206 for (;i!=j;++i) { … … 232 230 233 231 dodoStringArray array; 234 #ifndef USE_DEQUE235 232 array.reserve(map.size()); 236 #endif237 233 238 234 for (;o!=p;++o) -
sources/src/dataBaseSqlite.cc
r1464 r1500 213 213 unsigned int i = 0; 214 214 215 #ifndef USE_DEQUE216 215 rows->fields.reserve(numFields); 217 #endif218 216 219 217 for (i = 0; i < numFields; ++i) … … 241 239 242 240 values.clear(); 243 244 #ifndef USE_DEQUE245 241 values.reserve(numFields); 246 #endif247 242 248 243 for (i = 0; i < numFields; ++i) { … … 536 531 dodo_throw exception::basic(exception::MODULE_DATABASESQLITE, SQLITEEX_EXEC, exception::ERRNO_SQLITE, sqlite3_errcode(handle->handle), sqlite3_errmsg(handle->handle), __LINE__, __FILE__, collectedData.query->sql); 537 532 538 dodo List<__blob__>::iterator i(blobs.begin()), j(blobs.end());533 dodo::slList<__blob__>::iterator i(blobs.begin()), j(blobs.end()); 539 534 for (; i != j; ++i) { 540 535 if (sqlite3_bind_blob(handle->result, i->reference, i->value->data(), i->value->size(), SQLITE_TRANSIENT) != SQLITE_OK) { … … 626 621 blob.value = &(*j); 627 622 628 blobs.push _back(blob);623 blobs.push(blob); 629 624 } else { 630 625 request += dodo::string(statements[STATEMENT_EQUAL]); … … 656 651 blob.value = &(*j); 657 652 658 blobs.push _back(blob);653 blobs.push(blob); 659 654 } else { 660 655 request += dodo::string(statements[STATEMENT_EQUAL]); … … 736 731 blob.value = &(*i); 737 732 738 blobs.push _back(blob);733 blobs.push(blob); 739 734 } else 740 735 request += dodo::string(*i + statements[STATEMENT_COMA]); … … 756 751 blob.value = &(*i); 757 752 758 blobs.push _back(blob);753 blobs.push(blob); 759 754 } else 760 755 request += dodo::string(*i); … … 785 780 blob.value = &(*i); 786 781 787 blobs.push _back(blob);782 blobs.push(blob); 788 783 } else 789 784 request += dodo::string(*i + statements[STATEMENT_COMA]); … … 805 800 blob.value = &(*i); 806 801 807 blobs.push _back(blob);802 blobs.push(blob); 808 803 } else 809 804 request += dodo::string(*i); -
sources/src/dataTplProcessor.cc
r1464 r1500 704 704 705 705 if (tools::filesystem::exists(temp1)) { 706 processed.push _back(path);706 processed.push(path); 707 707 708 708 processFile(temp1, tpl); 709 709 710 processed.pop _back();710 processed.pop(); 711 711 } 712 712 } -
sources/src/pcExecutionManager.cc
r1464 r1500 216 216 //------------------------------------------------------------------- 217 217 218 dodo List<unsigned long>218 dodo::slList<unsigned long> 219 219 manager::jobs() 220 220 { 221 221 pc::sync::stack tg(keeper); 222 222 223 dodo List<unsigned long> jobs;223 dodo::slList<unsigned long> jobs; 224 224 225 225 dodoMap<unsigned long, execution::job *>::const_iterator i = handles.begin(), j = handles.end(); 226 226 227 227 for (; i != j; ++i) 228 jobs.push _back(i->first);228 jobs.push(i->first); 229 229 230 230 return jobs; -
sources/src/pcExecutionWorkqueue.cc
r1486 r1500 94 94 for (unsigned int i=0; i<minThreads; ++i) { 95 95 t = new thread((routine)workqueue::worker, this, ON_DESTRUCTION_STOP); 96 inactive.push _back(t);96 inactive.pushBack(t); 97 97 t->run(); 98 98 } … … 110 110 workqueue::~workqueue() 111 111 { 112 dodo List<thread *>::iterator i, j;113 dodo List<__work__ *>::iterator o, p;112 dodo::dlList<thread *>::iterator i, j; 113 dodo::dlList<__work__ *>::iterator o, p; 114 114 115 115 tasksProtector->acquire(); … … 148 148 bool active = false; 149 149 150 dodo List<thread *> &inactiveQueue = queue->inactive,150 dodo::dlList<thread *> &inactiveQueue = queue->inactive, 151 151 &activeQueue = queue->active; 152 152 sync::thread *tasksProtector = queue->tasksProtector, 153 153 *threadsProtector = queue->threadsProtector; 154 dodo List<__work__ *> &tasks = queue->tasks;155 156 threadsProtector->acquire(); 157 for (dodo List<thread *>::iterator i = inactiveQueue.begin(), j = inactiveQueue.end();154 dodo::dlList<__work__ *> &tasks = queue->tasks; 155 156 threadsProtector->acquire(); 157 for (dodo::dlList<thread *>::iterator i = inactiveQueue.begin(), j = inactiveQueue.end(); 158 158 i != j; 159 159 ++i) { … … 172 172 if (tasks.size()) { 173 173 work = *tasks.begin(); 174 tasks.pop _front();174 tasks.popFront(); 175 175 } else { 176 176 work = NULL; … … 182 182 threadsProtector->acquire(); 183 183 inactiveQueue.remove(self); 184 activeQueue.push _back(self);184 activeQueue.pushBack(self); 185 185 threadsProtector->release(); 186 186 … … 196 196 threadsProtector->acquire(); 197 197 activeQueue.remove(self); 198 inactiveQueue.push _back(self);198 inactiveQueue.pushBack(self); 199 199 threadsProtector->release(); 200 200 … … 265 265 266 266 tasksProtector->acquire(); 267 tasks.push _back(work);267 tasks.pushBack(work); 268 268 tasksProtector->release(); 269 269 … … 284 284 285 285 threadsProtector->acquire(); 286 inactive.push _back(t);286 inactive.pushBack(t); 287 287 threadsProtector->release(); 288 288 -
sources/src/toolsLogger.cc
r1439 r1500 98 98 lm.position = ++handlersNum; 99 99 100 handlers.push _back(lm);100 handlers.push(lm); 101 101 102 102 return handlersNum; … … 110 110 pc::sync::stack pg(keeper); 111 111 112 dodo List<__log_map__>::iterator i(handlers.begin()), j(handlers.end());112 dodo::slList<__log_map__>::iterator i(handlers.begin()), j(handlers.end()); 113 113 for (; i != j; ++i) { 114 114 if (i->position == position) { 115 handlers. erase(i);115 handlers.remove(i); 116 116 117 117 break; … … 131 131 return; 132 132 133 dodo List<__log_map__>::iterator i(handlers.begin()), j(handlers.end());133 dodo::slList<__log_map__>::iterator i(handlers.begin()), j(handlers.end()); 134 134 for (; i != j; ++i) { 135 135 if (i->level == level) { -
sources/src/toolsMisc.cc
r1497 r1500 152 152 cmpFunc = string::equal; 153 153 154 dodoStringList:: const_iterator i(arr.begin()), j(arr.end());154 dodoStringList::iterator i(arr.begin()), j(arr.end()); 155 155 for (; i != j; ++i) 156 156 if (cmpFunc(*i, needle)) -
sources/src/toolsRegexp.cc
r1464 r1500 137 137 return false; 138 138 139 #ifndef USE_DEQUE140 139 pockets.reserve(boundaries.size()); 141 #endif142 140 143 141 dodoArray<__regex_match__>::const_iterator i(boundaries.begin()), j(boundaries.end()); -
sources/src/types.cc
r1439 r1500 31 31 32 32 #include <vector> 33 #include <list>34 33 #include <deque> 35 34 #include <map> -
sources/src/xexec.cc
r1464 r1500 77 77 deinitModule deinit; 78 78 79 dodo List<__item__>::iterator i(preExec.begin()), j(preExec.end());79 dodo::slList<__item__>::iterator i(preExec.begin()), j(preExec.end()); 80 80 for (; i != j; ++i) { 81 81 if (i->handle == NULL) … … 111 111 112 112 int 113 xexec::addXExec(dodo List<__item__> &list,113 xexec::addXExec(dodo::slList<__item__> &list, 114 114 hook func, 115 115 void *data) … … 125 125 #endif 126 126 127 list.push _back(e);127 list.push(e); 128 128 129 129 return e.id; … … 136 136 { 137 137 if (getXexec(preExec, id)) 138 preExec. erase(current);138 preExec.remove(current); 139 139 else if (getXexec(postExec, id)) 140 postExec. erase(current);140 postExec.remove(current); 141 141 else 142 142 return; … … 192 192 193 193 void 194 xexec::performXExec(dodo List<__item__> &list,194 xexec::performXExec(dodo::slList<__item__> &list, 195 195 short operation) const 196 196 { … … 198 198 return; 199 199 200 dodo List<__item__>::iterator i(list.begin()), j(list.end());200 dodo::slList<__item__>::iterator i(list.begin()), j(list.end()); 201 201 202 202 for (; i != j; ++i) { … … 281 281 if (mod.type & ACTION_PREEXEC) { 282 282 e.id = ++execs; 283 preExec.push _back(e);283 preExec.push(e); 284 284 preExecId = e.id; 285 285 } … … 287 287 if (mod.type & ACTION_POSTEXEC) { 288 288 e.id = ++execs; 289 postExec.push _back(e);289 postExec.push(e); 290 290 postExecId = e.id; 291 291 } … … 297 297 298 298 bool 299 xexec::getXexec(dodo List<__item__> &list,299 xexec::getXexec(dodo::slList<__item__> &list, 300 300 int id) 301 301 { 302 dodo List<__item__>::iterator i(list.begin()), j(list.end());302 dodo::slList<__item__>::iterator i(list.begin()), j(list.end()); 303 303 for (; i != j; ++i) { 304 304 if (i->id == id) {
Note: See TracChangeset
for help on using the changeset viewer.
