Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions build.hxml
Original file line number Diff line number Diff line change
Expand Up @@ -4,55 +4,57 @@

# build flash9 library
# change the following line to the path of pureMVC framework sources
-cp /Users/marco/Documents/workspace_pureMVC/hx_pureMVC_multicore/src/
-cp ../puremvc-haxe-multicore-framework/src
-cp src
-swf bin/puremvc_pipes_fl9.swf
-swf bin/Utility_Haxe_MultiCore_Pipes_1_2_fl9.swf
-swf-version 9
org.puremvc.haxe.multicore.utilities.pipes.ImportAll

# build flash8 library
--next
# change the following line to the path of pureMVC framework sources
-cp /Users/marco/Documents/workspace_pureMVC/hx_pureMVC_multicore/src/
-cp ../puremvc-haxe-multicore-framework/src
-cp src
-swf bin/puremvc_pipes_fl8.swf
-swf bin/Utility_Haxe_MultiCore_Pipes_1_2_fl8.swf
-swf-version 8
org.puremvc.haxe.multicore.utilities.pipes.ImportAll

# build flash7 library
--next
# change the following line to the path of pureMVC framework sources
-cp /Users/marco/Documents/workspace_pureMVC/hx_pureMVC_multicore/src/
-cp ../puremvc-haxe-multicore-framework/src
-cp src
-swf bin/puremvc_pipes_fl7.swf
-swf bin/Utility_Haxe_MultiCore_Pipes_1_2_fl7.swf
-swf-version 7
org.puremvc.haxe.multicore.utilities.pipes.ImportAll

# build flash6 library
--next
# change the following line to the path of pureMVC framework sources
-cp /Users/marco/Documents/workspace_pureMVC/hx_pureMVC_multicore/src/
-cp ../puremvc-haxe-multicore-framework/src
-cp src
-swf bin/puremvc_pipes_fl6.swf
-swf bin/Utility_Haxe_MultiCore_Pipes_1_2_fl6.swf
-swf-version 6
org.puremvc.haxe.multicore.utilities.pipes.ImportAll

# build javascript library
--next
# change the following line to the path of pureMVC framework sources
-cp /Users/marco/Documents/workspace_pureMVC/hx_pureMVC_multicore/src/
-cp ../puremvc-haxe-multicore-framework/src
-cp src
-js bin/puremvc_pipes.js
org.puremvc.haxe.multicore.utilities.pipes.ImportAll

# build docs
# use the following command-line action to generate docs:
# haxedoc puremvc_pipes_docs.xml -f Array -f Bool -f org -f Class -f Dynamic -f Enum -f float -f Hash -f Int -f Iter -f List -f Math -f Null -f Reflect -f Std -f String -f Type -f Void -f Value
# haxedoc Utility_Haxe_MultiCore_Pipes_1_2_docs.xml -f Array -f Bool -f org -f Class -f Dynamic -f Enum -f float -f Hash -f Int -f Iter -f List -f Math -f Null -f Reflect -f Std -f String -f Type -f Void -f Value
--next
# change the following line to the path of pureMVC framework sources
-cp /Users/marco/Documents/workspace_pureMVC/hx_pureMVC_multicore/src/
-cp ../puremvc-haxe-multicore-framework/src
-cp src
-neko docs/all.n
-xml docs/puremvc_pipes_docs.xml
org.puremvc.haxe.multicore.utilities.pipes.ImportAll
-cmd cd docs
-cmd haxedoc puremvc_pipes_docs.xml -f Array -f Bool -f org -f Class -f Dynamic -f Enum -f float -f Hash -f Int -f Iter -f List -f Math -f Null -f Reflect -f Std -f String -f Type -f Void -f Value

4 changes: 2 additions & 2 deletions docs/template.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<html>

<head>
<title>haXe API Documentation</title>
<title>Haxe API Documentation</title>

<script type="text/javascript">
<!--
Expand Down Expand Up @@ -111,7 +111,7 @@ dt {
<body>

<div class="document">
<div class="title">PureMVC Framework for haXe: API Documentation</div>
<div class="title">PureMVC Framework for Haxe: API Documentation</div>

<data/>

Expand Down
116 changes: 66 additions & 50 deletions src/org/puremvc/haxe/multicore/utilities/pipes/plumbing/Filter.hx
Original file line number Diff line number Diff line change
Expand Up @@ -73,65 +73,81 @@ class Filter extends Pipe
{
var outputMessage: IPipeMessage = null;
var success: Bool = true;
// Filter normal messages
switch ( message.getType() )
var messageType: String = message.getType();

if (messageType == Message.NORMAL)
{
case Message.NORMAL:
try
{
if ( mode == FilterControlMessage.FILTER )
{
outputMessage = applyFilter( message );
}else
{
outputMessage = message;
}
success = output.write( outputMessage );
}catch ( e: Dynamic )
// Filter normal messages
try
{
if ( mode == FilterControlMessage.FILTER )
{
success = false;
outputMessage = applyFilter( message );
}

// Accept parameters from control message
case FilterControlMessage.SET_PARAMS:
if (isTarget(message) )
{
setParams( cast( message, FilterControlMessage ).getParams() );
}else
else
{
success = output.write( outputMessage );
outputMessage = message;
}
success = output.write( outputMessage );
}
catch ( e: Dynamic )
{
success = false;
}
}
else if (messageType == FilterControlMessage.SET_PARAMS)
{
// Accept parameters from control message
if (isTarget(message) )
{
setParams( cast( message, FilterControlMessage ).getParams() );
}
else
{
success = output.write( outputMessage );
}
}
else if (messageType == FilterControlMessage.SET_FILTER)
{
// Accept filter function from control message
case FilterControlMessage.SET_FILTER:
if ( isTarget( message ) )
{
setFilter( cast( message, FilterControlMessage ).getFilter() );
}else
{
success = output.write( outputMessage );
}
if ( isTarget( message ) )
{
setFilter( cast( message, FilterControlMessage ).getFilter() );
}
else
{
success = output.write( outputMessage );
}
}
else if (messageType == FilterControlMessage.BYPASS)
{
// Toggle between Filter or Bypass operational modes
case FilterControlMessage.BYPASS:
if ( isTarget( message ) )
{
mode = cast( message, FilterControlMessage ).getType();
}else
{
success = output.write( outputMessage );
}
case FilterControlMessage.FILTER:
if ( isTarget( message ) )
{
mode = cast( message, FilterControlMessage ).getType();
}else
{
success = output.write( outputMessage );
}

// Write control messages for other fittings through
default:
if ( isTarget( message ) )
{
mode = cast( message, FilterControlMessage ).getType();
}
else
{
success = output.write( outputMessage );
}
}
else if (messageType == FilterControlMessage.FILTER)
{
if ( isTarget( message ) )
{
mode = cast( message, FilterControlMessage ).getType();
}
else
{
success = output.write( outputMessage );
}
}
else
{
// Write control messages for other fittings through
success = output.write( outputMessage );
}

return success;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ package org.puremvc.haxe.multicore.utilities.pipes.plumbing;

import org.puremvc.haxe.multicore.utilities.pipes.interfaces.IPipeFitting;
import org.puremvc.haxe.multicore.utilities.pipes.interfaces.IPipeMessage;

#if haxe3
import haxe.ds.StringMap;
#else
private typedef StringMap<T> = Hash<T>;
#end

/**
* Pipe Junction.
Expand Down Expand Up @@ -40,8 +46,8 @@ class Junction
{
inputPipes = new Array();
outputPipes = new Array();
pipesMap = new Hash();
pipeTypesMap = new Hash();
pipesMap = new StringMap();
pipeTypesMap = new StringMap();
}

/**
Expand Down Expand Up @@ -188,11 +194,11 @@ class Junction
/**
* The map of pipe names to their pipes
*/
private var pipesMap: Hash<IPipeFitting>;
private var pipesMap: StringMap<IPipeFitting>;

/**
* The map of pipe names to their types
*/
private var pipeTypesMap: Hash<String>;
private var pipeTypesMap: StringMap<String>;

}
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,26 @@ class JunctionMediator extends Mediator
*/
override public function handleNotification( note: INotification ): Void
{
switch( note.getName() )
var noteName: String = note.getName();

if (noteName == JunctionMediator.ACCEPT_INPUT_PIPE)
{
// accept an input pipe
// register the pipe and if successful
// set this mediator as its listener
case JunctionMediator.ACCEPT_INPUT_PIPE:
var inputPipeName: String = note.getType();
var inputPipe: IPipeFitting = if ( Std.is( note.getBody(), IPipeFitting) ) note.getBody() else null;
if ( junction.registerPipe( inputPipeName, Junction.INPUT, inputPipe ) )
{
junction.addPipeListener( inputPipeName, this, handlePipeMessage );
}

var inputPipeName: String = note.getType();
var inputPipe: IPipeFitting = if ( Std.is( note.getBody(), IPipeFitting) ) note.getBody() else null;
if ( junction.registerPipe( inputPipeName, Junction.INPUT, inputPipe ) )
{
junction.addPipeListener( inputPipeName, this, handlePipeMessage );
}
}
else if (noteName == JunctionMediator.ACCEPT_OUTPUT_PIPE)
{
// accept an output pipe
case JunctionMediator.ACCEPT_OUTPUT_PIPE:
var outputPipeName: String = note.getType();
var outputPipe: IPipeFitting = if ( Std.is( note.getBody(), IPipeFitting) ) note.getBody() else null;
junction.registerPipe( outputPipeName, Junction.OUTPUT, outputPipe );
var outputPipeName: String = note.getType();
var outputPipe: IPipeFitting = if ( Std.is( note.getBody(), IPipeFitting) ) note.getBody() else null;
junction.registerPipe( outputPipeName, Junction.OUTPUT, outputPipe );
}
}

Expand All @@ -98,12 +100,21 @@ class JunctionMediator extends Mediator
/**
* The Junction for this Module.
*/
private var junction( getJunction, null ): Junction;
#if haxe3
private var junction( get, null ): Junction;
#else
private var junction( get_junction, null ): Junction;
#end

private function getJunction()
private function get_junction()
{
return if ( Std.is( viewComponent, Junction ) ) viewComponent else null;
}

private function getJunction()
{
return get_junction();
}


}
27 changes: 17 additions & 10 deletions src/org/puremvc/haxe/multicore/utilities/pipes/plumbing/Queue.hx
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,31 @@ class Queue extends Pipe
override public function write( message: IPipeMessage ): Bool
{
var success: Bool = true;
switch ( message.getType() )
var messageType: String = message.getType();

if (messageType == Message.NORMAL)
{
// Store normal messages
case Message.NORMAL:
this.store( message );

this.store( message );
}
else if (messageType == QueueControlMessage.FLUSH)
{
// Flush the queue
case QueueControlMessage.FLUSH:
success = this.flush();
success = this.flush();
}
else if (messageType == QueueControlMessage.SORT)
{
// Put Queue into Priority Sort or FIFO mode
// Subsequent messages written to the queue
// will be affected. Sorted messages cannot
// be put back into FIFO order!
case QueueControlMessage.SORT:
mode = message.getType();
case QueueControlMessage.FIFO:
mode = message.getType();
mode = message.getType();
}
else if (messageType == QueueControlMessage.FIFO)
{
mode = message.getType();
}

return success;
}

Expand Down