Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: The Value Class Up: The Glish Client Library Previous: The Client Class


The Proxy and ProxyStore Classes

Figure 15.2: Proxy Clients
\begin{figure*}
\begin{footnotesize}
\begin{tgrind}[c]
\File{proxy.cc},{16:16},{...
...stor.Loop();}}
\L {\LB{}\Tab{8}{\}}}
\end{tgrind}\end{footnotesize}\end{figure*}

To create proxy clients, the ProxyStore class (which is derived from Client) is created instead of the Client class. The ProxyStore object that is created then acts as a repository for proxy clients. These proxy clients are simply objects derived from the Proxy base class. Once the initial setup is complete, the interface which is used for creating and managing these proxy clients is straight forward.

Figure § 15.2 shows a simple example of how proxy clients can be created. In this case, a particular proxy client, ProxyA, is created each time a make event is is sent to the client process. Messages are printed when the constructor, destructor, or Create function is called. In addition, any events (other than make) are responded to with the id of the proxy client in question. An interaction with this client would look something like:

    - tp := client('tproxy')
    - one := tp->make()
    In ProxyA::Create
    Created a ProxyA: 21014:2:1
    - two := tp->make() 
    In ProxyA::Create
    Created a ProxyA: 21014:2:2
    - three := tp->make()
    In ProxyA::Create
    Created a ProxyA: 21014:2:3
    - print two->id()
    2
    - print three->id()
    3
    - two := 0
    Deleted a ProxyA: 21014:2:2
As you can see, the proxy clients behave just like any other client. Events can be sent to and received from them, and when they are deleted in the interpreter, their destructor is called in the client.


next up previous contents index
Next: The Value Class Up: The Glish Client Library Previous: The Client Class   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15