|
From: Marek P. <ma...@us...> - 2001-08-09 23:22:59
|
Update of /cvsroot/javaprofiler/library/src/setup
In directory usw-pr-cvs1:/tmp/cvs-serv7456/src/setup
Modified Files:
setup.cpp setup.h
Log Message:
no message
Index: setup.cpp
===================================================================
RCS file: /cvsroot/javaprofiler/library/src/setup/setup.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** setup.cpp 2001/07/30 15:41:26 1.2
--- setup.cpp 2001/08/09 23:22:55 1.3
***************
*** 1,5 ****
#include "../main/includes.h"
! Setup::Setup() {
alloc.turnedOn = 1;
--- 1,5 ----
#include "../main/includes.h"
! Setup::Setup( char* options) {
alloc.turnedOn = 1;
***************
*** 13,16 ****
--- 13,18 ----
cpu.traceDepth = 2;
cpu.threadsEnabled = 1;
+
+ if( options) processOptions( options);
}
***************
*** 145,149 ****
return;
}
- }
--- 147,189 ----
return;
}
+ if( !strcmp( name, "commun_type")) {
+
+ if( !strcmp( value, "socket")) com.communType = IProf::COMMUN_SOCKET;
+ else if( !strcmp( value, "shmem")) com.communType = IProf::COMMUN_SHMEM;
+
+ return;
+ }
+
+ if( !strcmp( name, "commun_host")) {
+
+ com.hostname = value;
+ return;
+ }
+
+ if( !strcmp( name, "commun_port")) {
+
+ com.port = (unsigned short)atoi( value);
+ return;
+ }
+ if( !strcmp( name, "commun_shmem_size")) {
+
+ com.shmemSize = atoi( value);
+ return;
+ }
+
+ if( !strcmp( name, "commun_shmem_str")) {
+
+ com.shmemStr = value;
+ return;
+ }
+
+ if( !strcmp( name, "connect_mode")) {
+
+ if( !strcmp( value, "normal")) com.listenMode = 0;
+ else if( !strcmp( value, "listen")) com.listenMode = 1;
+
+ return;
+ }
+ }
Index: setup.h
===================================================================
RCS file: /cvsroot/javaprofiler/library/src/setup/setup.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** setup.h 2001/07/30 15:41:26 1.3
--- setup.h 2001/08/09 23:22:55 1.4
***************
*** 6,10 ****
** profiler start-up. Default values are used for missing ones.
**
! ** @author Petr Luner */
class Setup {
--- 6,10 ----
** profiler start-up. Default values are used for missing ones.
**
! ** @author Petr Luner, Marek Przeczek */
class Setup {
***************
*** 59,62 ****
--- 59,98 ----
};
+ /// setup for communication
+ struct Com {
+
+ /// type of communication
+ IProf::eCommunType communType;
+
+ /// listening connector mode (1 = on, 0 = off)
+ int listenMode;
+
+ /// hostname (if sockets used and connect_mode set to "listen")
+ String hostname;
+
+ /// TCP port (if sockets used)
+ unsigned short port;
+
+ /// shared memory size - in bytes (if shmem used)
+ int shmemSize;
+
+ /// shared memory name (identifier) - 3 characters
+ String shmemId;
+
+ /// initialization
+ Com() :
+
+ communType( IProf::COMMUN_SOCKET),
+ listenMode( 0),
+
+ hostname( "127.0.0.1"),
+ port( IProf::COMMUN_PORT),
+
+ shmemSize( IProf::COMMUN_SHMEM_SIZE),
+ shmemId( "com")
+
+ {};
+ };
+
/// Memory profiling
Alloc alloc;
***************
*** 65,74 ****
Cpu cpu;
public:
/** Constructor.
! ** Sets setup parameters to their default values. */
! Setup();
/** Sets parameters according to command line options.
--- 101,117 ----
Cpu cpu;
+ /// Communication
+ Com com;
+
public:
/** Constructor.
! ** Sets setup parameters to their default values.
! ** If an argument is not NULL, given options
! ** from command-line are processed.
! **
! ** @param options command-line options */
! Setup( char* options = NULL);
/** Sets parameters according to command line options.
|