Cliser

cliser
Class CPlusPlusGenerator

java.lang.Object
  |
  +--cliser.Generator
        |
        +--cliser.CPlusPlusGenerator

public class CPlusPlusGenerator
extends Generator

A CPlusPlusGenerator is used by a given Cliser interface to generate C++ code for a client-server system, as specified by the parameters entered at the interface.

See the class constructor for the parameters.


Constructor Summary
CPlusPlusGenerator(java.lang.String serviceName, int port, java.lang.String protocol, java.lang.String networkInterface)
          Constructor for use by a CLI.
CPlusPlusGenerator(java.lang.String serviceName, int port, java.lang.String protocol, java.lang.String networkInterface, java.awt.Frame parentFrame)
          Constructor for use by a Cliser GUI.
 
Method Summary
 void generateClient()
          Generate C++ client-code using parameters given to my constructor.
 void generateMakefile(boolean buildClient, boolean buildServer, java.lang.String serverType)
          Generate Makefile for C++ code.
 void generateServer(java.lang.String serverType)
          Generate C++ server code using constructor parameters and serverType.
 java.lang.String getNetworkInterface()
          Access my network interface information.
 
Methods inherited from class cliser.Generator
getPort, getProtocol, getService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CPlusPlusGenerator

public CPlusPlusGenerator(java.lang.String serviceName,
                          int port,
                          java.lang.String protocol,
                          java.lang.String networkInterface,
                          java.awt.Frame parentFrame)
Constructor for use by a Cliser GUI.
Parameters:
serviceName - the name of the service
port - the port the service should use
protocol - "TCP" or "UDP"
networkInterface - "BSD" or "TLI" or "Winsock"
parentFrame - the Frame of my GUI

Precondition: serviceName is the name of the service (e.g., "ftp")
&& port is the port for this service
&& protocol is either "TCP" or "UDP"
&& networkInterface is either "BSD", "TLI", or "Winsock"
&& parentFrame refers to my parent GUI
Postcondition: my instance variables have been initialized
using the parameter values.


CPlusPlusGenerator

public CPlusPlusGenerator(java.lang.String serviceName,
                          int port,
                          java.lang.String protocol,
                          java.lang.String networkInterface)
Constructor for use by a CLI.
Parameters:
serviceName - the name of the service
port - the port the service should use
protocol - "TCP" or "UDP"
networkInterface - "BSD" or "TLI" or "Winsock"
parentFrame - the Frame of my GUI

Precondition: serviceName is the name of the service (e.g., "ftp")
&& port is the port for this service
&& protocol is either "TCP" or "UDP"
&& networkInterface is either "BSD", "TLI", or "Winsock"
Postcondition: my instance variables have been initialized
using the parameter values && myParentFrame == null.

Method Detail

getNetworkInterface

public final java.lang.String getNetworkInterface()
Access my network interface information.
Returns:
myNetworkInterface

generateClient

public void generateClient()
Generate C++ client-code using parameters given to my constructor. Postcondition: the source code has been generated for a client for myService, using myPort, myNetworkInterface, and myProtocol
Overrides:
generateClient in class Generator

generateServer

public void generateServer(java.lang.String serverType)
Generate C++ server code using constructor parameters and serverType.
Parameters:
serverType - "Iterative" or "Unix" or "POSIX"

Precondition: serverType is "Iterative" for an iterative/single threaded server
"Unix" for a Unix concurrent server
"POSIX" for a POSIX threaded concurrent server

Postcondition: the source code has been generated for a server for myService, using myPort, myNetworkInterface, and myProtocol

Overrides:
generateServer in class Generator

generateMakefile

public void generateMakefile(boolean buildClient,
                             boolean buildServer,
                             java.lang.String serverType)
Generate Makefile for C++ code.
Parameters:
buildClient - true iff the user wants a client
buildServer - true iff the user wants a server
serverType - "Iterative" or "Concurrent" (for Java) "Iterative" or "Unix" or "POSIX" (for C++)

Precondition: (buildServer is true && mySourceLanguage is "Java")
--> (serverType is "Iterative" || serverType is "Concurrent")
&& (buildServer is true && mySourceLanguage is "C++")
--> (serverType == "Iterative"
|| serverType == "Unix"
|| serverType == "POSIX").

Postcondition: A Makefile has been generated to compile the user program.

Overrides:
generateMakefile in class Generator

Cliser

Cliser is open-source freeware distributed under the GNU Public License.