diff options
Diffstat (limited to 'apps/JAWS/remora/app')
-rwxr-xr-x | apps/JAWS/remora/app/Makefile | 19 | ||||
-rw-r--r-- | apps/JAWS/remora/app/Remora_Export.cc | 93 | ||||
-rw-r--r-- | apps/JAWS/remora/app/Remora_Export.h | 85 | ||||
-rw-r--r-- | apps/JAWS/remora/app/Remora_Export.i | 146 | ||||
-rw-r--r-- | apps/JAWS/remora/app/Remora_Import.cc | 109 | ||||
-rw-r--r-- | apps/JAWS/remora/app/Remora_Import.h | 69 | ||||
-rw-r--r-- | apps/JAWS/remora/app/Remora_Import.i | 85 | ||||
-rw-r--r-- | apps/JAWS/remora/app/remora.idl | 100 | ||||
-rwxr-xr-x | apps/JAWS/remora/app/stdmk | 40 | ||||
-rw-r--r-- | apps/JAWS/remora/app/test.cc | 77 |
10 files changed, 0 insertions, 823 deletions
diff --git a/apps/JAWS/remora/app/Makefile b/apps/JAWS/remora/app/Makefile deleted file mode 100755 index 1a75b69b87f..00000000000 --- a/apps/JAWS/remora/app/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -include stdmk - -EXE = test - -all: $(EXE) - -clean: - -rm -f core *~ *.o *_c.hh *_c.cc *_s.hh *_s.cc $(EXE) - -rm -rf Templates.DB - -remora_c.cc: remora.idl - $(ORBCC) remora.idl - -remora_s.cc: remora.idl - $(ORBCC) remora.idl - -test: remora_c.o Remora_Import.o Remora_Export.o test.o - $(CC) -o test test.o remora_c.o Remora_Import.o Remora_Export.o \ - $(LIBPATH) $(LIBORB) $(STDCC_LIBS) $(LIBACE) diff --git a/apps/JAWS/remora/app/Remora_Export.cc b/apps/JAWS/remora/app/Remora_Export.cc deleted file mode 100644 index e416ac83156..00000000000 --- a/apps/JAWS/remora/app/Remora_Export.cc +++ /dev/null @@ -1,93 +0,0 @@ -// $Id$ - -#include "Remora_Export.h" - - -Remora_Export::Remora_Export(const char* label, int value, int max_value) - : remora_agent_(0) -{ - this->stat_.value_ = value; - this->stat_.label_ = label; - this->stat_.max_ = max_value; - - this->init(); -} - -Remora_Export::Remora_Export(const Remora_Export& export) - : remora_agent_(export.remora_agent_) -{ - this->stat_.value_ = export.stat_.value_; - this->stat_.label_ = export.stat_.label_; - this->stat_.max_ = export.stat_.max_; -} - -Remora_Export::~Remora_Export() -{ - PMCTRY - { - if (this->remora_agent_ != 0) - { - this->remora_agent_->removeStatistic(this->stat_.label_); - this->remora_agent_->_release(); - } - } - PMCCATCH(remora::Invalid_Statistic, excp) - { - } - PMCAND_CATCH(CORBA::SystemException, excp) - { - CORBA::release(this->remora_agent_); - } - PMCEND_CATCH - -} - -void -Remora_Export::init() -{ - PMCTRY - { - int argc = 1; - char* argv[1]; - argv[0] = STATS_AGENT_NAME; - - CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - - cout << this->stat_.label_ << " Binding to server..." << endl; - this->remora_agent_ = - remora::Remora_Statistics_Agent::_bind(STATS_AGENT_NAME); - - cout << this->stat_.label_ << " Registering Statistic..." << endl; - this->remora_agent_->acceptNewStatistic(this->stat_); - } - PMCCATCH(CORBA::Exception, excp) - { - cerr << excp << endl; - } - PMCEND_CATCH -} - -void -Remora_Export::update_value(int new_value) -{ - this->stat_.value_ = new_value; - - PMCTRY - { - cout << this->stat_.label_ << " Updating a value." << endl; - if (this->remora_agent_ != 0 && (! this->remora_agent_->_non_existent())) - this->remora_agent_->updateStatistic(this->stat_); - } - PMCCATCH(CORBA::SystemException, sysex) - { - cerr << sysex << endl; - this->remora_agent_->_release(); - this->remora_agent_ = 0; - } - PMCAND_CATCH(remora::Invalid_Statistic, excp) - { - cerr << excp << endl; - } - PMCEND_CATCH -} - diff --git a/apps/JAWS/remora/app/Remora_Export.h b/apps/JAWS/remora/app/Remora_Export.h deleted file mode 100644 index 379f3bb1a82..00000000000 --- a/apps/JAWS/remora/app/Remora_Export.h +++ /dev/null @@ -1,85 +0,0 @@ -// $Id - -// =================================================================== -// -// = FILENAME -// Remora_Export.h -// -// = AUTHOR -// Seth Widoff -// -// =================================================================== - - -#ifndef REMORA_EXPORT_H -#define REMORA_EXPORT_H - -#include <bstring.h> -#include "remora_c.hh" - -#define MAX_VALUE 100 -#define NO_NAME "Unnamed Statistic" -#define STATS_AGENT_NAME "Remora Statistics Agent" - -class Remora_Export -{ -public: - - Remora_Export(const char* label = NO_NAME, int value = 0, - int max_value = MAX_VALUE); - - Remora_Export(const Remora_Export& export); - - ~Remora_Export(); - - void operator=(const int new_value); - void operator=(const Remora_Export& export); - - void operator+=(const int new_value); - void operator+=(const Remora_Export& export); - - void operator*=(const int new_value); - void operator*=(const Remora_Export& export); - - void operator/=(const int new_value); - void operator/=(const Remora_Export& export); - - void operator-=(const int new_value); - void operator-=(const Remora_Export& export); - - operator CORBA::Long() const; - operator CORBA::Long&(); - - friend int operator==(const Remora_Export& me, const int new_value); - friend int operator==(const Remora_Export& me, const Remora_Export& export); - - friend int operator!=(const Remora_Export& me, const int new_value); - friend int operator!=(const Remora_Export& me, const Remora_Export& export); - - friend int operator<=(const Remora_Export& me, const int new_value); - friend int operator<=(const Remora_Export& me, const Remora_Export& export); - - friend int operator>=(const Remora_Export& me, const int new_value); - friend int operator>=(const Remora_Export& me, const Remora_Export& export); - - friend int operator<(const Remora_Export& me, const int new_value); - friend int operator<(const Remora_Export& me, const Remora_Export& export); - - friend int operator>(const Remora_Export& me, const int new_value); - friend int operator>(const Remora_Export& me, const Remora_Export& export); - -private: - - void init(); - - void update_value(int new_value); - - remora::Statistic stat_; - - remora::Remora_Statistics_Agent_ptr remora_agent_; - -}; - -#include "Remora_Export.i" - -#endif diff --git a/apps/JAWS/remora/app/Remora_Export.i b/apps/JAWS/remora/app/Remora_Export.i deleted file mode 100644 index f4b158721d2..00000000000 --- a/apps/JAWS/remora/app/Remora_Export.i +++ /dev/null @@ -1,146 +0,0 @@ -// $Id - -inline void -Remora_Export::operator=(const int new_value) -{ - this->update_value(new_value); -} - -inline void -Remora_Export::operator=(const Remora_Export& export) -{ - this->update_value(export.stat_.value_); -} - -inline void -Remora_Export::operator+=(const int new_value) -{ - this->update_value(this->stat_.value_ + new_value); -} - -inline void -Remora_Export::operator+=(const Remora_Export& export) -{ - this->update_value(this->stat_.value_ + export.stat_.value_); -} - -inline void -Remora_Export::operator-=(const int new_value) -{ - this->update_value(this->stat_.value_ - new_value); -} - -inline void -Remora_Export::operator-=(const Remora_Export& export) -{ - this->update_value(this->stat_.value_ - export.stat_.value_); -} - -inline void -Remora_Export::operator*=(const int new_value) -{ - this->update_value(this->stat_.value_ * new_value); -} - -inline void -Remora_Export::operator*=(const Remora_Export& export) -{ - this->update_value(this->stat_.value_ * export.stat_.value_); -} - -inline void -Remora_Export::operator/=(const int new_value) -{ - this->update_value(this->stat_.value_ / new_value); -} - -inline void -Remora_Export::operator/=(const Remora_Export& export) -{ - this->update_value(this->stat_.value_ / export.stat_.value_); -} - -inline -Remora_Export::operator CORBA::Long() const -{ - return this->stat_.value_; -} - -inline -Remora_Export::operator CORBA::Long&() -{ - return this->stat_.value_; -} - -inline int -operator==(const Remora_Export& me, const int new_value) -{ - return me.stat_.value_ == new_value; -} - -inline int -operator==(const Remora_Export& me, const Remora_Export& export) -{ - return me.stat_.value_ == export.stat_.value_; -} - -inline int -operator!=(const Remora_Export& me, const int new_value) -{ - return me.stat_.value_ != new_value; -} - -inline int -operator!=(const Remora_Export& me, const Remora_Export& export) -{ - return me.stat_.value_ != export.stat_.value_; -} - -inline int -operator<=(const Remora_Export& me, const int new_value) -{ - return me.stat_.value_ <= new_value; -} - -inline int -operator<=(const Remora_Export& me, const Remora_Export& export) -{ - return me.stat_.value_ <= export.stat_.value_; -} - -inline int -operator>=(const Remora_Export& me, const int new_value) -{ - return me.stat_.value_ >= new_value; -} - -inline int -operator>=(const Remora_Export& me, const Remora_Export& export) -{ - return me.stat_.value_ >= export.stat_.value_; -} - -inline int -operator<(const Remora_Export& me, const int new_value) -{ - return me.stat_.value_ < new_value; -} - -inline int -operator<(const Remora_Export& me, const Remora_Export& export) -{ - return me.stat_.value_ < export.stat_.value_; -} - -inline int -operator>(const Remora_Export& me, const int new_value) -{ - return me.stat_.value_ > new_value; -} - -inline int -operator>(const Remora_Export& me, const Remora_Export& export) -{ - return me.stat_.value_ > export.stat_.value_; -} - diff --git a/apps/JAWS/remora/app/Remora_Import.cc b/apps/JAWS/remora/app/Remora_Import.cc deleted file mode 100644 index c97451f0566..00000000000 --- a/apps/JAWS/remora/app/Remora_Import.cc +++ /dev/null @@ -1,109 +0,0 @@ -// $Id$ - -#include "Remora_Import.h" - -Remora_Import::Remora_Import(const char* label, int value, - int min_value, int max_value) - : remora_agent_(0) -{ - this->control_.value_ = value; - this->control_.label_ = label; - this->control_.max_ = max_value; - this->control_.min_ = min_value; - - this->init(); -} - -Remora_Import::Remora_Import(const Remora_Import& import) - : remora_agent_(import.remora_agent_) -{ - this->control_.value_ = import.control_.value_; - this->control_.label_ = import.control_.label_; - this->control_.max_ = import.control_.max_; - this->control_.min_ = import.control_.min_; -} - -Remora_Import::~Remora_Import() -{ - PMCTRY - { - if (this->remora_agent_ != 0) - { - this->remora_agent_->removeControl(this->control_.label_); - this->remora_agent_->_release(); - } - } - PMCCATCH(remora::Invalid_Statistic, excp) - { - cerr << "Tried to remove invalid statistic."; - } - PMCAND_CATCH(CORBA::SystemException, excp) - { - CORBA::release(this->remora_agent_); - } - PMCEND_CATCH -} - -void -Remora_Import::init() -{ - PMCTRY - { - int argc = 1; - char* argv[1]; - argv[0] = CONTROL_AGENT_NAME; - - CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - - cout << this->control_.label_ << " Binding to server..." << endl; - this->remora_agent_ = - remora::Remora_Controls_Agent::_bind(CONTROL_AGENT_NAME); - - cout << this->control_.label_ << " Registering Control..." << endl; - this->remora_agent_->acceptNewControl(this->control_); - } - PMCCATCH(CORBA::Exception, excp) - { - cerr << excp << endl; - } - PMCEND_CATCH -} - -CORBA::Long -Remora_Import::grab_value(void) -{ - PMCTRY - { - if (this->remora_agent_ != 0) - { - cout << this->control_.label_ << " Grabbing a value from the client." << endl; - this->remora_agent_->getControlState(this->control_); - } - - // C++ exception handling needs a 'finally' construct - return this->control_.value_; - } - PMCCATCH(CORBA::SystemException, sysex) - { - cerr << sysex << endl; - this->remora_agent_->_release(); - this->remora_agent_ = 0; - - return this->control_.value_; - } - PMCAND_CATCH(remora::Invalid_Control, excp) - { - PMCTRY - { - this->remora_agent_->acceptNewControl(this->control_); - } - PMCCATCH(CORBA::SystemException, sysex2) - { - return this->control_.value_; - } - PMCEND_CATCH - - return this->control_.value_; - } - PMCEND_CATCH -} diff --git a/apps/JAWS/remora/app/Remora_Import.h b/apps/JAWS/remora/app/Remora_Import.h deleted file mode 100644 index 8cfecd84ac4..00000000000 --- a/apps/JAWS/remora/app/Remora_Import.h +++ /dev/null @@ -1,69 +0,0 @@ -// $Id - -// =================================================================== -// -// = FILENAME -// Remora_Import.h -// -// = AUTHOR -// Seth Widoff -// -// =================================================================== - -#ifndef REMORA_IMPORT_H -#define REMORA_IMPORT_H - -#include <bstring.h> -#include "remora_c.hh" - -#define NO_NAME "Unnamed Statistic" -#define MAX_VALUE 100 -#define CONTROL_AGENT_NAME "Remora Controls Agent" - -class Remora_Import -{ -public: - - Remora_Import(const char * label = NO_NAME, int value = 0, - int min_value = 0, int max_value = MAX_VALUE); - - Remora_Import(const Remora_Import& import); - - ~Remora_Import(); - - CORBA::Long get(void); - - operator CORBA::Long(); - - friend int operator==( Remora_Import& me, int new_value); - friend int operator==( Remora_Import& me, Remora_Import& export); - - friend int operator!=( Remora_Import& me, int new_value); - friend int operator!=( Remora_Import& me, Remora_Import& export); - - friend int operator<=( Remora_Import& me, int new_value); - friend int operator<=( Remora_Import& me, Remora_Import& export); - - friend int operator>=( Remora_Import& me, int new_value); - friend int operator>=( Remora_Import& me, Remora_Import& export); - - friend int operator<( Remora_Import& me, int new_value); - friend int operator<( Remora_Import& me, Remora_Import& export); - - friend int operator>( Remora_Import& me, int new_value); - friend int operator>( Remora_Import& me, Remora_Import& export); - -private: - - void init(); - - CORBA::Long grab_value(); - - remora::Control control_; - - remora::Remora_Controls_Agent_ptr remora_agent_; - -}; - -#include "Remora_Import.i" -#endif diff --git a/apps/JAWS/remora/app/Remora_Import.i b/apps/JAWS/remora/app/Remora_Import.i deleted file mode 100644 index 48fc01f3ed7..00000000000 --- a/apps/JAWS/remora/app/Remora_Import.i +++ /dev/null @@ -1,85 +0,0 @@ -// $Id - -inline -Remora_Import::operator CORBA::Long() -{ - return this->grab_value(); -} - -inline CORBA::Long -Remora_Import::get(void) -{ - return this->grab_value(); -} - -inline int -operator==( Remora_Import& me, int new_value) -{ - return me.grab_value() == new_value; -} - -inline int -operator==( Remora_Import& me, Remora_Import& import) -{ - return me.grab_value() == import.grab_value(); -} - -inline int -operator!=( Remora_Import& me, int new_value) -{ - return me.grab_value() != new_value; -} - -inline int -operator!=( Remora_Import& me, Remora_Import& import) -{ - return me.grab_value() != import.grab_value(); -} - -inline int -operator<=( Remora_Import& me, int new_value) -{ - return me.grab_value() <= new_value; -} - -inline int -operator<=( Remora_Import& me, Remora_Import& import) -{ - return me.grab_value() <= import.grab_value(); -} - -inline int -operator>=( Remora_Import& me, int new_value) -{ - return me.grab_value() >= new_value; -} - -inline int -operator>=( Remora_Import& me, Remora_Import& import) -{ - return me.grab_value() >= import.grab_value(); -} - -inline int -operator<( Remora_Import& me, int new_value) -{ - return me.grab_value() < new_value; -} - -inline int -operator<( Remora_Import& me, Remora_Import& import) -{ - return me.grab_value() < import.grab_value(); -} - -inline int -operator>( Remora_Import& me, int new_value) -{ - return me.grab_value() > new_value; -} - -inline int -operator>( Remora_Import& me, Remora_Import& import) -{ - return me.grab_value() > import.grab_value(); -} diff --git a/apps/JAWS/remora/app/remora.idl b/apps/JAWS/remora/app/remora.idl deleted file mode 100644 index 4f6c8713099..00000000000 --- a/apps/JAWS/remora/app/remora.idl +++ /dev/null @@ -1,100 +0,0 @@ -// $Id - -// =================================================================== -// -// = FILENAME -// remora.idl -// -// = AUTHOR -// Seth Widoff -// -// =================================================================== - -// The IDL interface for the published Remora interfaces. - -module remora -{ - struct Statistic - { - string label_; - long value_; - long max_; - }; - - struct Control - { - string label_; - long value_; - long min_; - long max_; - }; - - typedef long Token; - typedef sequence<Statistic> Statistics_List; - typedef sequence<Control> Controls_List; - - exception Invalid_Statistic {}; - exception Invalid_Control {}; - - interface Statistics_Update - { - void acceptNewStatistic(in Statistic stat) raises (Invalid_Statistic); - - void updateStatistic(in Statistic stat) raises (Invalid_Statistic); - - void removeStatistic(in string label) raises (Invalid_Statistic); - }; - - interface Controls_Update - { - void acceptNewControl(in Control control) raises (Invalid_Control); - - void getControlState(inout Control control) raises (Invalid_Control); - - void removeControl(in string label) raises (Invalid_Control); - }; - - // Located in an applet, the client receives and displays - // statistics from the server. - interface Remora_Statistics_Client : Statistics_Update - { - oneway void acceptManyStatistics(in Statistics_List stats, in long length); - - oneway void updateManyStatistics(in Statistics_List stats, in long length); - // Update all statistics registered with the client - - oneway void shutdownStatistics(); - // Suggest that the client shut itself down - }; - - interface Remora_Controls_Client : Controls_Update - { - oneway void acceptManyControls(in Controls_List controls, in long length); - // Deliver many new controls to the client. - - oneway void shutdownControls(); - }; - - // Located on the server side, the Agent delivers statistics to - // registered clients. - interface Remora_Statistics_Agent : Statistics_Update - { - oneway void setFrequency(in long id, in long update_time); - // Set the frequency at which the Agent will transmit - // the statistics to the clients. - - long registerClient(in Remora_Statistics_Client client, in long update_time); - // Register a client for periodic updates. - - oneway void terminateRegistration(in long client_id); - // Unregister the client from the server. - }; - - interface Remora_Controls_Agent : Controls_Update - { - Token grabControlLock(in Remora_Controls_Client client); - - void releaseControlLock(in Token token); - }; -}; - diff --git a/apps/JAWS/remora/app/stdmk b/apps/JAWS/remora/app/stdmk deleted file mode 100755 index c966f9ef9fc..00000000000 --- a/apps/JAWS/remora/app/stdmk +++ /dev/null @@ -1,40 +0,0 @@ -CC = CC -DEBUG = - -DOVE = /project/waltz/seth/doc/dove - -ACE_DIR = /project/waltz/seth/ACE_wrappers - -ORBELINEDIR = /project/waltz/Orbeline2.0 - -STL_DIR = /project/flamenco/irfan/STL/work-in-progress/Solaris-port.STL/Microsoft/STL - -ORBCC = $(ORBELINEDIR)/bin/orbeline -v _c -m _s -S exceptions - -CCINCLUDES = -I. -I$(ORBELINEDIR)/include -I$(STL_DIR) -I$(ACE_DIR) - -CCFLAGS = -g $(CCINCLUDES) $(DEBUG) - -LIBPATH = -L$(ORBELINEDIR)/lib -L$(ACE_DIR)/ace - -STDCC_LIBS = -lsocket -lnsl -ldl -mt - -LIBORB = -lorb - -LIBACE = -lACE - -.SUFFIXES: .C .o .h .hh .cc .cpp - -.C.o: - $(CC) $(CCFLAGS) -c -o $@ $< - -.cc.o: - $(CC) $(CCFLAGS) -c -o $@ $< - -.C.cpp: - $(CC) -E $(CCFLAGS) $< > $@ - -.cc.cpp: - $(CC) -E $(CCFLAGS) $< > $@ - - diff --git a/apps/JAWS/remora/app/test.cc b/apps/JAWS/remora/app/test.cc deleted file mode 100644 index 76158aac5a5..00000000000 --- a/apps/JAWS/remora/app/test.cc +++ /dev/null @@ -1,77 +0,0 @@ -// $Id - -#include <unistd.h> -#include <stdlib.h> -#include <iostream.h> -#include "ace/Signal.h" -#include "Remora_Export.h" -#include "Remora_Import.h" - -class Shutdown : public ACE_Event_Handler -{ -public: - Shutdown(int& cond) : cond_(cond) {} - - virtual int handle_signal(int, siginfo*, ucontext*) - { - this->cond_ = 0; - return 0; - } - -private: - - int& cond_; -}; - - -int -main(int argc, char** argv) -{ - int lcv = 1; - ACE_Sig_Handler shutdown; - - shutdown.register_handler(SIGINT, new Shutdown(lcv)); - - try - { - Remora_Export cpu("CPU Usage", 0, 100); - Remora_Export thread("Thread Count", 0, 24); - Remora_Export through("Throughput", 0, 150); - Remora_Export energy("Energy Levels", 0, 2084); - Remora_Export warp("Warp Drive Output", 0, 1023); - - Remora_Import in_threads("Threads", 1, 0, 24); - Remora_Import in_tachyon("Tachyon Emmissions", 25, 0, 100); - Remora_Import in_shields("Shield Integrity", 100, 0, 100); - Remora_Import in_phasers("Phaser Power", 421, 0, 1024); - - while (lcv) - { - cpu = rand() % 100; - thread = rand() % 24; - energy = rand() % 2084; - through = rand() % 150; - warp = rand() % 1023; - - cout << "Statistics: " << endl; - cout << "CPU: " << CORBA::Long(cpu) << endl; - cout << "Thread: " << CORBA::Long(thread) << endl; - cout << "Throughput: " << CORBA::Long(through) << endl; - cout << "Energy: " << CORBA::Long(energy) << endl; - cout << "Warp: " << CORBA::Long(cpu) << endl; - - cout << "Controls: " << endl; - cout << "Threads: " << CORBA::Long(in_threads) << endl; - cout << "Tachyon: " << CORBA::Long(in_tachyon) << endl; - cout << "Shields: " << CORBA::Long(in_shields) << endl; - cout << "Phasers: " << CORBA::Long(in_phasers) << endl; - - sleep(1); - } - } - catch(CORBA::SystemException& e) - { - - cerr << e << endl; - } -} |