Permalink
Browse files

Moved list to Data, which is a package for data structures. Implement…

…ed many atomic operations for Synch.
  • Loading branch information...
1 parent 9e35ddc commit b3e8c976f23827458959151da5937514fb1fa8fe @wilkie committed May 3, 2010
View
@@ -38,9 +38,10 @@ DFILES_PLATFORM_WIN = binding/win32/gdipluscolormatrix.d binding/win32/gdiplusin
DFILES_PLATFORM_XOMB = platform/xomb/main.d platform/xomb/common.d platform/xomb/scaffold.d platform/xomb/vars.d platform/xomb/console.d platform/xomb/definitions.d platform/xomb/scaffolds/wave.d platform/xomb/scaffolds/graphics.d platform/xomb/scaffolds/thread.d platform/xomb/scaffolds/menu.d platform/xomb/scaffolds/window.d platform/xomb/scaffolds/view.d platform/xomb/scaffolds/color.d platform/xomb/scaffolds/file.d platform/xomb/scaffolds/socket.d platform/xomb/scaffolds/app.d platform/xomb/scaffolds/time.d platform/xomb/oscontrolinterface.d
DFILES_ANALYZING = analyzing/debugger.d
-DFILES_CORE = core/locales/en_us.d core/locales/fr_fr.d core/date.d core/locale.d core/variant.d core/list.d core/exception.d core/event.d core/library.d core/system.d core/random.d core/regex.d core/arguments.d core/definitions.d core/application.d core/time.d core/timezone.d core/unicode.d core/endian.d core/stream.d core/string.d core/main.d core/color.d
+DFILES_LOCALES = locales/en_us.d locales/fr_fr.d locales/all.d
+DFILES_CORE = core/date.d core/locale.d core/variant.d core/exception.d core/event.d core/library.d core/system.d core/regex.d core/arguments.d core/definitions.d core/application.d core/time.d core/timezone.d core/unicode.d core/endian.d core/stream.d core/string.d core/main.d core/color.d
DFILES_GUI = gui/container.d gui/trackbar.d gui/radiogroup.d gui/progressbar.d gui/togglefield.d gui/listfield.d gui/listbox.d gui/vscrollbar.d gui/hscrollbar.d gui/button.d gui/textfield.d gui/window.d gui/widget.d gui/application.d
-DFILES_UTILS = utils/stack.d utils/linkedlist.d utils/fibonacci.d utils/heap.d
+DFILES_DATA = data/stack.d data/queue.d data/queue2.d data/fibonacci.d data/heap.d data/list.d data/iterable.d
DFILES_PARSING = parsing/d/trees.d parsing/d/addexprunit.d parsing/d/andexprunit.d parsing/d/assignexprunit.d parsing/d/blockstmtunit.d parsing/d/switchstmtunit.d parsing/d/casestmtunit.d parsing/d/defaultstmtunit.d parsing/d/breakstmtunit.d parsing/d/continuestmtunit.d parsing/d/gotostmtunit.d parsing/d/returnstmtunit.d parsing/d/volatilestmtunit.d parsing/d/throwstmtunit.d parsing/d/postfixexprlistunit.d parsing/d/cmpexprunit.d parsing/d/conditionalexprunit.d parsing/d/declarationunit.d parsing/d/expressionunit.d parsing/d/importdeclunit.d parsing/d/isexprunit.d parsing/d/lexer.d parsing/d/logicalandexprunit.d parsing/d/logicalorexprunit.d parsing/d/moduledeclunit.d parsing/d/moduleunit.d parsing/d/mulexprunit.d parsing/d/nodes.d parsing/d/orexprunit.d parsing/d/parser.d parsing/d/postfixexprunit.d parsing/d/primaryexprunit.d parsing/d/shiftexprunit.d parsing/d/staticunit.d parsing/d/declaratorunit.d parsing/d/declaratorsuffixunit.d parsing/d/declaratortypeunit.d parsing/d/tokens.d parsing/d/enumdeclunit.d parsing/d/typeunit.d parsing/d/enumbodyunit.d parsing/d/aggregatedeclunit.d parsing/d/aggregatebodyunit.d parsing/d/classbodyunit.d parsing/d/templatebodyunit.d parsing/d/interfacebodyunit.d parsing/d/classdeclunit.d parsing/d/interfacedeclunit.d parsing/d/constructorunit.d parsing/d/destructorunit.d parsing/d/parameterlistunit.d parsing/d/functionbodyunit.d parsing/d/staticifunit.d parsing/d/versionunit.d parsing/d/debugunit.d parsing/d/unittestunit.d parsing/d/parameterunit.d parsing/d/basictypeunit.d parsing/d/statementunit.d parsing/d/pragmastmtunit.d parsing/d/staticassertunit.d parsing/d/foreachstmtunit.d parsing/d/scopedstmtunit.d parsing/d/forstmtunit.d parsing/d/typedeclarationunit.d parsing/d/unaryexprunit.d parsing/d/xorexprunit.d parsing/ast.d parsing/lexer.d parsing/token.d parsing/parser.d parsing/options.d parsing/cfg.d parsing/parseunit.d
DFILES = djehuty.d
DFILES_BINARY_CODECS = decoders/binary/decoder.d decoders/binary/base64.d decoders/binary/yEnc.d decoders/binary/deflate.d decoders/binary/zlib.d
@@ -57,15 +58,15 @@ DFILES_TUI = tui/filebox.d tui/container.d tui/dialog.d tui/window.d tui/applica
DFILES_SCRIPTING = scripting/lua.d
DFILES_BINDING = binding/opengl/gl.d binding/opengl/glu.d binding/lua.d
DFILES_INTERFACES = interfaces/container.d
-DFILES_MATH = math/currency.d math/fixed.d math/integer.d math/common.d math/vector.d math/matrix.d math/mathobject.d
+DFILES_MATH = math/random.d math/currency.d math/fixed.d math/integer.d math/common.d math/vector.d math/matrix.d math/mathobject.d
DFILES_OPENGL = opengl/window.d opengl/texture.d opengl/light.d
DFILES_SPECS = specs/test.d
DFILES_TESTING = testing/dspec.d testing/support.d testing/logic.d
DFILES_SYNCH = synch/atomic.d synch/condition.d synch/barrier.d synch/mutex.d synch/semaphore.d synch/thread.d synch/timer.d
DFILES_RSC =
-OBJS_CORE = $(DFILES:.d=.o) $(DFILES_RESOURCE:.d=.o) $(DFILES_IO:.d=.o) $(DFILES_SYNCH:.d=.o) $(DFILES_PARSING:.d=.o) $(DFILES_OPENGL:.d=.o) $(DFILES_TUI:.d=.o) $(DFILES_ANALYZING:.d=.o) $(DFILES_SCRIPTING:.d=.o) $(DFILES_BINDING:.d=.o) $(DFILES_SPECS:.d=.o) $(DFILES_TESTING:.d=.o) $(DFILES_MATH:.d=.o) $(DFILES_GRAPHICS:.d=.o) $(DFILES_HASHES:.d=.o) $(DFILES_RSC:.d=.o) $(DFILES_NETWORKING:.d=.o) $(DFILES_INTERFACES:.d=.o) $(DFILES_UTILS:.d=.o) $(DFILES_CONSOLE:.d=.o) $(DFILES_BINARY_CODECS:.d=.o) $(DFILES_CODEC:.d=.o) $(DFILES_IMAGE_CODECS:.d=.o) $(DFILES_AUDIO_CODECS:.d=.o) $(DFILES_CORE:.d=.o) $(DFILES_GUI:.d=.o) $(DFILES_PARSERS:.d=.o)
+OBJS_CORE = $(DFILES:.d=.o) $(DFILES_LOCALES:.d=.o) $(DFILES_RESOURCE:.d=.o) $(DFILES_IO:.d=.o) $(DFILES_SYNCH:.d=.o) $(DFILES_PARSING:.d=.o) $(DFILES_OPENGL:.d=.o) $(DFILES_TUI:.d=.o) $(DFILES_ANALYZING:.d=.o) $(DFILES_SCRIPTING:.d=.o) $(DFILES_BINDING:.d=.o) $(DFILES_SPECS:.d=.o) $(DFILES_TESTING:.d=.o) $(DFILES_MATH:.d=.o) $(DFILES_GRAPHICS:.d=.o) $(DFILES_HASHES:.d=.o) $(DFILES_RSC:.d=.o) $(DFILES_NETWORKING:.d=.o) $(DFILES_INTERFACES:.d=.o) $(DFILES_DATA:.d=.o) $(DFILES_CONSOLE:.d=.o) $(DFILES_BINARY_CODECS:.d=.o) $(DFILES_CODEC:.d=.o) $(DFILES_IMAGE_CODECS:.d=.o) $(DFILES_AUDIO_CODECS:.d=.o) $(DFILES_CORE:.d=.o) $(DFILES_GUI:.d=.o) $(DFILES_PARSERS:.d=.o)
OBJS_MAC = $(OBJS_CORE) $(DFILES_PLATFORM_MAC:.d=.o) $(OBJC_FILES:.m=.o)
View
@@ -7,7 +7,7 @@ import io.console;
import core.definitions;
-import utils.linkedlist;
+import data.queue;
// Section: Console
@@ -46,7 +46,7 @@ class Prompt {
}
if (bufferSize != 0) {
- _lineBuffer = new LinkedList!(string)();
+ _lineBuffer = new Queue!(string)();
}
else {
_lineBuffer = null;
@@ -291,7 +291,7 @@ protected:
fgColor _promptClr = fgColor.White;
fgColor _clr = fgColor.White;
- LinkedList!(string) _lineBuffer;
+ Queue!(string) _lineBuffer;
int _bufferSize;
int _bufferPos;
View
@@ -2,9 +2,9 @@ module core.arguments;
import core.definitions;
import core.util;
-
import core.string;
-import core.list;
+
+import data.list;
// Description: This class holds the command line arguments that were passed into the app and will aid in parsing them.
class Arguments : List!(string) {
View
@@ -16,8 +16,7 @@ import core.string;
import core.definitions;
// Supported Locales
-import core.locales.en_us;
-import core.locales.fr_fr;
+import locales.all;
enum LocaleId : uint {
English_US,
View
@@ -13,92 +13,92 @@ module core.regex;
import core.string;
import core.definitions;
-import core.list;
import synch.thread;
import io.console;
-import utils.stack;
+import data.stack;
+import data.list;
// This provides thread-local access to regex variables set via
// Regex groups.
uint _position() {
- if (Thread.getCurrent() in Regex.regexPos) {
- return Regex.regexPos[Thread.getCurrent()];
+ if (Thread.current() in Regex.regexPos) {
+ return Regex.regexPos[Thread.current()];
}
return uint.max;
}
string _1() {
- if (Thread.getCurrent() in Regex.regexRefs) {
- return Regex.regexRefs[Thread.getCurrent()][0];
+ if (Thread.current() in Regex.regexRefs) {
+ return Regex.regexRefs[Thread.current()][0];
}
return ("");
}
string _2() {
- if (Thread.getCurrent() in Regex.regexRefs) {
- return Regex.regexRefs[Thread.getCurrent()][1];
+ if (Thread.current() in Regex.regexRefs) {
+ return Regex.regexRefs[Thread.current()][1];
}
return ("");
}
string _3() {
- if (Thread.getCurrent() in Regex.regexRefs) {
- return Regex.regexRefs[Thread.getCurrent()][2];
+ if (Thread.current() in Regex.regexRefs) {
+ return Regex.regexRefs[Thread.current()][2];
}
return ("");
}
string _4() {
- if (Thread.getCurrent() in Regex.regexRefs) {
- return Regex.regexRefs[Thread.getCurrent()][3];
+ if (Thread.current() in Regex.regexRefs) {
+ return Regex.regexRefs[Thread.current()][3];
}
return ("");
}
string _5() {
- if (Thread.getCurrent() in Regex.regexRefs) {
- return Regex.regexRefs[Thread.getCurrent()][4];
+ if (Thread.current() in Regex.regexRefs) {
+ return Regex.regexRefs[Thread.current()][4];
}
return ("");
}
string _6() {
- if (Thread.getCurrent() in Regex.regexRefs) {
- return Regex.regexRefs[Thread.getCurrent()][5];
+ if (Thread.current() in Regex.regexRefs) {
+ return Regex.regexRefs[Thread.current()][5];
}
return ("");
}
string _7() {
- if (Thread.getCurrent() in Regex.regexRefs) {
- return Regex.regexRefs[Thread.getCurrent()][6];
+ if (Thread.current() in Regex.regexRefs) {
+ return Regex.regexRefs[Thread.current()][6];
}
return ("");
}
string _8() {
- if (Thread.getCurrent() in Regex.regexRefs) {
- return Regex.regexRefs[Thread.getCurrent()][7];
+ if (Thread.current() in Regex.regexRefs) {
+ return Regex.regexRefs[Thread.current()][7];
}
return ("");
}
string _9() {
- if (Thread.getCurrent() in Regex.regexRefs) {
- return Regex.regexRefs[Thread.getCurrent()][8];
+ if (Thread.current() in Regex.regexRefs) {
+ return Regex.regexRefs[Thread.current()][8];
}
return ("");
@@ -183,7 +183,7 @@ class Regex {
bool backtrackedOnCaret = false;
- regexRefs[Thread.getCurrent()] = new string [](9);
+ regexRefs[Thread.current()] = new string [](9);
// Suppresses group matching until a position is reached.
int noMatchUntilClosedAtPos = -1;
@@ -549,7 +549,7 @@ class Regex {
if (!noMatch) {
if (regexGroupStart < 9) {
string consumed = (str[regexInfo.groupInfo[regexInfo.groupInfo[regexPos].startPos].strStartPos..strPos]);
- regexRefs[Thread.getCurrent()][regexGroupStart] = consumed;
+ regexRefs[Thread.current()][regexGroupStart] = consumed;
regexGroupStart++;
}
}
@@ -1004,11 +1004,11 @@ class Regex {
int refIndex = cast(uint)regex[regexPos] - cast(uint)'1';
// forward and backward references
- if (Thread.getCurrent() in regexRefs) {
- if (regexRefs[Thread.getCurrent()][refIndex] !is null) {
+ if (Thread.current() in regexRefs) {
+ if (regexRefs[Thread.current()][refIndex] !is null) {
matchMade = true;
- foreach(int i, chr; regexRefs[Thread.getCurrent()][refIndex]) {
+ foreach(int i, chr; regexRefs[Thread.current()][refIndex]) {
if (strPos >= str.length) {
matchMade = false;
@@ -1179,9 +1179,9 @@ class Regex {
}
// Null out any outstanding groups
- if (Thread.getCurrent() in regexRefs) {
+ if (Thread.current() in regexRefs) {
for( ; regexGroupStart < 9 ; regexGroupStart++ ) {
- // regexRefs[Thread.getCurrent()][regexGroupStart]
+ // regexRefs[Thread.current()][regexGroupStart]
// = null;
}
}
@@ -1198,7 +1198,7 @@ class Regex {
}
// Save the position where the string was consumed
- this.regexPos[Thread.getCurrent()] = strPosStart;
+ this.regexPos[Thread.current()] = strPosStart;
// Slice and return the consumed string
return str.substring(strPosStart, strPos-strPosStart);
@@ -18,11 +18,11 @@
*
*/
-module utils.fibonacci;
+module data.fibonacci;
import core.util;
-import utils.heap;
+import data.heap;
class FibonacciHeap(T, bool minHeap = true) : HeapInterface!(T, minHeap) {
@@ -9,12 +9,11 @@
*
*/
-module utils.heap;
+module data.heap;
-import core.list;
-import core.util;
+import data.list;
-import utils.heap;
+import core.util;
enum : bool {
MinHeap = true,
Oops, something went wrong.

0 comments on commit b3e8c97

Please sign in to comment.