<cfcomponent
output="false"
hint="Holds a queue of messages.">
<cfset VARIABLES.Instance = {} />
<cfset VARIABLES.Instance.Queue = [] />
<cffunction
name="Init"
access="public"
returntype="any"
output="false"
hint="Returns an intialized component.">
<cfreturn THIS />
</cffunction>
<cffunction
name="Add"
access="public"
returntype="any"
output="false"
hint="Adds a message to the internal queue and then returns This reference for method chaining.">
<cfargument
name="Message"
type="string"
required="true"
hint="The queue to add to the message."
/>
<cfset ArrayAppend(
VARIABLES.Instance.Queue,
ARGUMENTS.Message
) />
<cfreturn THIS />
</cffunction>
<cffunction
name="GetMessages"
access="public"
returntype="array"
output="false"
hint="Returns a copy of the internal message queue.">
<cfreturn VARIABLES.Instance.Queue />
</cffunction>
<cffunction
name="Size"
access="public"
returntype="numeric"
output="false"
hint="Returns the size of the internal message queue.">
<cfreturn ArrayLen( VARIABLES.Instance.Queue ) />
</cffunction>
</cfcomponent>