Changeset 3743
- Timestamp:
- 05/08/07 17:37:41 (6 years ago)
- Location:
- platform/logService
- Files:
-
- 16 modified
-
CosLwLogAdministrator.idl (modified) (1 diff)
-
CosLwLogConsumer.idl (modified) (1 diff)
-
CosLwLogProducer.idl (modified) (1 diff)
-
CosLwLogService.idl (modified) (1 diff)
-
CosLwLogStatus.idl (modified) (1 diff)
-
LogAdministrator_impl.cpp (modified) (3 diffs)
-
LogAdministrator_impl.h (modified) (3 diffs)
-
LogConsumer_impl.cpp (modified) (6 diffs)
-
LogConsumer_impl.h (modified) (3 diffs)
-
LogProducer_impl.cpp (modified) (3 diffs)
-
LogProducer_impl.h (modified) (3 diffs)
-
LogStatus_impl.cpp (modified) (2 diffs)
-
LogStatus_impl.h (modified) (3 diffs)
-
Log_impl.h (modified) (1 diff)
-
Makefile (modified) (1 diff)
-
main.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
platform/logService/CosLwLogAdministrator.idl
r3615 r3743 8 8 #endif 9 9 10 module CosLwLog{10 module LogService { 11 11 interface LogAdministrator : LogStatus { 12 12 void set_max_size(in unsigned long long size) -
platform/logService/CosLwLogConsumer.idl
r3615 r3743 8 8 #endif 9 9 10 module CosLwLog{10 module LogService { 11 11 interface LogConsumer : LogStatus { 12 12 RecordId get_record_id_from_time (in LogTime fromTime); -
platform/logService/CosLwLogProducer.idl
r3615 r3743 8 8 #endif 9 9 10 module CosLwLog{10 module LogService { 11 11 interface LogProducer : LogStatus { 12 12 oneway void write_records( -
platform/logService/CosLwLogService.idl
r3615 r3743 10 10 #endif 11 11 12 module CosLwLog12 module LogService 13 13 { 14 14 interface Log : LogAdministrator, LogConsumer, LogProducer {}; -
platform/logService/CosLwLogStatus.idl
r3615 r3743 6 6 #endif 7 7 8 module CosLwLog{8 module LogService { 9 9 10 10 //#ifndef _PRE_3_0_COMPILER_ -
platform/logService/LogAdministrator_impl.cpp
r3633 r3743 1 1 #include "LogAdministrator_impl.h" 2 2 3 void LogAdministrator_impl::set _max_size(CORBA::ULongLong size)4 throw ( CosLwLog::InvalidParam)3 void LogAdministrator_impl::setMaxSize(CORBA::ULongLong size) 4 throw (LogService::InvalidParam) 5 5 { 6 6 // … … 10 10 // Assume zero max_length logs are invalid 11 11 // 12 // Bad assumption, JTAP tests for 0 length log. 13 // 12 14 13 if (size < 1) {14 throw CosLwLog::InvalidParam("Log size must be greater than 0");15 if (size < 0) { 16 throw LogService::InvalidParam("Log size cannot be negative"); 15 17 } 16 18 … … 31 33 } 32 34 33 void LogAdministrator_impl::set _log_full_action(CosLwLog::LogFullAction action)35 void LogAdministrator_impl::setLogFullAction(LogService::LogFullAction action) 34 36 { 35 37 log_full_action = action; 36 38 } 37 39 38 void LogAdministrator_impl::set _administrative_state(39 CosLwLog::AdministrativeState state)40 void LogAdministrator_impl::setAdministrativeState( 41 LogService::AdministrativeState state) 40 42 { 41 43 administrative_state = state; 42 44 43 if (administrative_state == CosLwLog::locked) {45 if (administrative_state == LogService::locked) { 44 46 availability_status.off_duty = true; 45 47 } 46 else if (administrative_state == CosLwLog::unlocked &&47 operational_state == CosLwLog::enabled) {48 else if (administrative_state == LogService::unlocked && 49 operational_state == LogService::enabled) { 48 50 availability_status.off_duty = false; 49 51 } 50 52 } 51 53 52 void LogAdministrator_impl::clear _log()54 void LogAdministrator_impl::clearLog() 53 55 { 54 56 // -
platform/logService/LogAdministrator_impl.h
r3630 r3743 1 #include " CosLwLogAdministrator.h"1 #include "LogServiceAdministrator.h" 2 2 3 3 #ifndef LOGSTATUS_IMPL_H … … 6 6 #endif 7 7 8 class LogAdministrator_impl : public virtual POA_ CosLwLog::LogAdministrator,8 class LogAdministrator_impl : public virtual POA_LogService::LogAdministrator, 9 9 public virtual LogStatus_impl 10 10 { … … 17 17 ~LogAdministrator_impl(); 18 18 19 void set _max_size(CORBA::ULongLong size)20 throw ( CosLwLog::InvalidParam);21 void set _log_full_action(CosLwLog::LogFullAction action);22 void set _administrative_state(CosLwLog::AdministrativeState state);23 void clear _log();19 void setMaxSize(CORBA::ULongLong size) 20 throw (LogService::InvalidParam); 21 void setLogFullAction(LogService::LogFullAction action); 22 void setAdministrativeState(LogService::AdministrativeState state); 23 void clearLog(); 24 24 void destroy(); 25 25 -
platform/logService/LogConsumer_impl.cpp
r3732 r3743 1 1 #include "LogConsumer_impl.h" 2 2 3 CosLwLog::RecordId4 LogConsumer_impl::get _record_id_from_time(const CosLwLog::LogTime& fromTime)3 LogService::RecordId 4 LogConsumer_impl::getRecordIdFromTime(const LogService::LogTime& fromTime) 5 5 { 6 6 // … … 11 11 } 12 12 13 CosLwLog::LogRecordSequence*14 LogConsumer_impl::retrieve _records(CosLwLog::RecordId& currentId, CORBA::ULong&13 LogService::LogRecordSequence* 14 LogConsumer_impl::retrieveRecords(LogService::RecordId& currentId, CORBA::ULong& 15 15 howMany) 16 16 { … … 22 22 // 23 23 24 CosLwLog::LogRecordSequence* return_sequence;24 LogService::LogRecordSequence* return_sequence; 25 25 26 26 test_mutex->acquire(); 27 27 28 return_sequence = new CosLwLog::LogRecordSequence(*log_record_sequence);28 return_sequence = new LogService::LogRecordSequence(*log_record_sequence); 29 29 return_sequence->length(log_record_size); 30 30 … … 34 34 } 35 35 36 CosLwLog::LogRecordSequence*37 LogConsumer_impl::retrieve _records_by_level(CosLwLog::RecordId& currentId,38 CORBA::ULong& howMany, const CosLwLog::LogLevelSequence& valueList)36 LogService::LogRecordSequence* 37 LogConsumer_impl::retrieveRecordsByLevel(LogService::RecordId& currentId, 38 CORBA::ULong& howMany, const LogService::LogLevelSequence& valueList) 39 39 { 40 40 // … … 45 45 } 46 46 47 CosLwLog::LogRecordSequence*48 LogConsumer_impl::retrieve _records_by_producer_id(CosLwLog::RecordId& currentId,49 CORBA::ULong& howMany, const CosLwLog::StringSeq& valueList)47 LogService::LogRecordSequence* 48 LogConsumer_impl::retrieveRecordsByProducerId(LogService::RecordId& currentId, 49 CORBA::ULong& howMany, const LogService::StringSeq& valueList) 50 50 { 51 51 // … … 56 56 } 57 57 58 CosLwLog::LogRecordSequence*59 LogConsumer_impl::retrieve _records_by_producer_name(CosLwLog::RecordId& currentId,60 CORBA::ULong& howMany, const CosLwLog::StringSeq& valueList)58 LogService::LogRecordSequence* 59 LogConsumer_impl::retrieveRecordsByProducerName(LogService::RecordId& currentId, 60 CORBA::ULong& howMany, const LogService::StringSeq& valueList) 61 61 { 62 62 // -
platform/logService/LogConsumer_impl.h
r3574 r3743 1 #include " CosLwLogConsumer.h"1 #include "LogServiceConsumer.h" 2 2 3 3 #ifndef LOGSTATUS_IMPL_H … … 6 6 #endif 7 7 8 class LogConsumer_impl : public virtual POA_ CosLwLog::LogConsumer,8 class LogConsumer_impl : public virtual POA_LogService::LogConsumer, 9 9 public virtual LogStatus_impl 10 10 { … … 17 17 ~LogConsumer_impl(); 18 18 19 CosLwLog::RecordId get_record_id_from_time(const CosLwLog::LogTime&19 LogService::RecordId getRecordIdFromTime(const LogService::LogTime& 20 20 fromTime); 21 21 22 CosLwLog::LogRecordSequence* retrieve_records(CosLwLog::RecordId& currentId,22 LogService::LogRecordSequence* retrieveRecords(LogService::RecordId& currentId, 23 23 CORBA::ULong& howMany); 24 24 25 CosLwLog::LogRecordSequence* retrieve_records_by_level(CosLwLog::RecordId&26 currentId, CORBA::ULong& howMany, const CosLwLog::LogLevelSequence&25 LogService::LogRecordSequence* retrieveRecordsByLevel(LogService::RecordId& 26 currentId, CORBA::ULong& howMany, const LogService::LogLevelSequence& 27 27 valueList); 28 28 29 CosLwLog::LogRecordSequence* retrieve_records_by_producer_id(30 CosLwLog::RecordId& currentId, CORBA::ULong& howMany, const31 CosLwLog::StringSeq& valueList);29 LogService::LogRecordSequence* retrieveRecordsByProducer_id( 30 LogService::RecordId& currentId, CORBA::ULong& howMany, const 31 LogService::StringSeq& valueList); 32 32 33 CosLwLog::LogRecordSequence* retrieve_records_by_producer_name(34 CosLwLog::RecordId& currentId, CORBA::ULong& howMany, const35 CosLwLog::StringSeq& valueList);33 LogService::LogRecordSequence* retrieveRecordsByProducerName( 34 LogService::RecordId& currentId, CORBA::ULong& howMany, const 35 LogService::StringSeq& valueList); 36 36 }; -
platform/logService/LogProducer_impl.cpp
r3629 r3743 4 4 5 5 void 6 LogProducer_impl::write_records(const CosLwLog::ProducerLogRecordSequence&6 LogProducer_impl::write_records(const LogService::ProducerLogRecordSequence& 7 7 records) 8 8 { … … 13 13 14 14 void 15 LogProducer_impl::write_record(const CosLwLog::ProducerLogRecord& record)15 LogProducer_impl::write_record(const LogService::ProducerLogRecord& record) 16 16 { 17 17 if (!availability_status.off_duty) { … … 24 24 } 25 25 26 CosLwLog::LogTime time;26 LogService::LogTime time; 27 27 time.seconds = tv.tv_sec; 28 28 time.nanoseconds = tv.tv_usec * 1000; 29 29 30 30 // Assign unique 64bit id 31 CosLwLog::RecordId id = currentId++;31 LogService::RecordId id = currentId++; 32 32 33 33 // Create new log entry 34 CosLwLog::LogRecord newLogRecord;34 LogService::LogRecord newLogRecord; 35 35 newLogRecord.id = id; 36 36 newLogRecord.time = time; -
platform/logService/LogProducer_impl.h
r3574 r3743 1 #include < CosLwLogProducer.h>1 #include <LogServiceProducer.h> 2 2 3 3 #ifndef LOGSTATUS_IMPL_H … … 6 6 #endif 7 7 8 class LogProducer_impl : public virtual POA_ CosLwLog::LogProducer,8 class LogProducer_impl : public virtual POA_LogService::LogProducer, 9 9 public virtual LogStatus_impl 10 10 { … … 16 16 ~LogProducer_impl(); 17 17 18 void write_records(const CosLwLog::ProducerLogRecordSequence& records);19 void write_record(const CosLwLog::ProducerLogRecord& record);18 void write_records(const LogService::ProducerLogRecordSequence& records); 19 void write_record(const LogService::ProducerLogRecord& record); 20 20 21 21 }; -
platform/logService/LogStatus_impl.cpp
r3629 r3743 16 16 log_record_max_size = max_size; 17 17 18 log_record_sequence = new CosLwLog::LogRecordSequence();18 log_record_sequence = new LogService::LogRecordSequence(); 19 19 log_record_sequence->length(max_size); 20 20 21 operational_state = CosLwLog::enabled;22 administrative_state = CosLwLog::unlocked;23 log_full_action = CosLwLog::HALT;21 operational_state = LogService::enabled; 22 administrative_state = LogService::unlocked; 23 log_full_action = LogService::HALT; 24 24 25 25 availability_status.off_duty = 0; … … 41 41 } 42 42 43 unsigned long long LogStatus_impl::get _max_size()43 unsigned long long LogStatus_impl::getMaxSize() 44 44 { 45 return log_record_max_size; 45 unsigned long long returnSize = log_record_max_size; 46 return returnSize; 46 47 } 47 48 48 unsigned long long LogStatus_impl::get _current_size()49 unsigned long long LogStatus_impl::getCurrentSize() 49 50 { 50 51 return log_record_size; 51 52 } 52 53 53 unsigned long long LogStatus_impl::get _n_records()54 unsigned long long LogStatus_impl::getNumRecords() 54 55 { 55 // Figure what this should do56 return 0;56 unsigned long long returnVal = log_record_size; 57 return returnVal; 57 58 } 58 59 59 CosLwLog::LogFullAction LogStatus_impl::get_log_full_action()60 LogService::LogFullAction LogStatus_impl::getLogFullAction() 60 61 { 61 62 return log_full_action; 62 63 } 63 64 64 CosLwLog::AvailabilityStatus LogStatus_impl::get_availability_status()65 LogService::AvailabilityStatus LogStatus_impl::getAvailabilityStatus() 65 66 { 66 return availability_status; 67 std::cout << "In getAvailabilityStatus()" << std::endl; 68 69 LogService::AvailabilityStatus returnStatus = availability_status; 70 return returnStatus; 67 71 } 68 72 69 CosLwLog::AdministrativeState LogStatus_impl::get_administrative_state()73 LogService::AdministrativeState LogStatus_impl::getAdministrativeState() 70 74 { 71 75 return administrative_state; 72 76 } 73 77 74 CosLwLog::OperationalState LogStatus_impl::get_operational_state()78 LogService::OperationalState LogStatus_impl::getOperationalState() 75 79 { 76 80 return operational_state; -
platform/logService/LogStatus_impl.h
r3627 r3743 1 #include " CosLwLogStatus.h"1 #include "LogServiceStatus.h" 2 2 3 3 #define MAX_SIZE_DEFAULT 1000 4 4 5 class LogStatus_impl : public virtual POA_ CosLwLog::LogStatus5 class LogStatus_impl : public virtual POA_LogService::LogStatus 6 6 { 7 7 … … 11 11 omni_mutex *test_mutex; 12 12 13 CosLwLog::LogRecordSequence* log_record_sequence;14 CosLwLog::OperationalState operational_state;15 CosLwLog::AdministrativeState administrative_state;16 CosLwLog::LogFullAction log_full_action;17 CosLwLog::AvailabilityStatus availability_status;13 LogService::LogRecordSequence* log_record_sequence; 14 LogService::OperationalState operational_state; 15 LogService::AdministrativeState administrative_state; 16 LogService::LogFullAction log_full_action; 17 LogService::AvailabilityStatus availability_status; 18 18 19 19 unsigned int log_record_max_size; … … 26 26 ~LogStatus_impl(); 27 27 28 unsigned long long get _max_size();29 unsigned long long get _current_size();30 unsigned long long get _n_records();31 CosLwLog::LogFullAction get_log_full_action();32 CosLwLog::AdministrativeState get_administrative_state();33 CosLwLog::AvailabilityStatus get_availability_status();34 CosLwLog::OperationalState get_operational_state();28 unsigned long long getMaxSize(); 29 unsigned long long getCurrentSize(); 30 unsigned long long getNumRecords(); 31 LogService::LogFullAction getLogFullAction(); 32 LogService::AdministrativeState getAdministrativeState(); 33 LogService::AvailabilityStatus getAvailabilityStatus(); 34 LogService::OperationalState getOperationalState(); 35 35 36 36 }; -
platform/logService/Log_impl.h
r3574 r3743 3 3 #include "LogConsumer_impl.h" 4 4 5 #include " CosLwLogService.h"5 #include "LogService.h" 6 6 7 struct Log_impl : public POA_ CosLwLog::Log,7 struct Log_impl : public POA_LogService::Log, 8 8 public LogProducer_impl, 9 9 public LogAdministrator_impl, -
platform/logService/Makefile
r3732 r3743 1 1 CFLAGS = -Wall 2 SOURCES = LogStatus_impl.cpp LogProducer_impl.cpp LogConsumer_impl.cpp LogAdministrator_impl.cpp Log_impl.cpp main.cpp CosLwLogStatusSK.cpp CosLwLogProducerSK.cpp CosLwLogConsumerSK.cpp CosLwLogAdministratorSK.cpp CosLwLogServiceSK.cpp3 LIBS = -lomniORB4 -lossieidl2 SOURCES = LogStatus_impl.cpp LogProducer_impl.cpp LogConsumer_impl.cpp LogAdministrator_impl.cpp Log_impl.cpp main.cpp LogServiceStatusSK.cpp LogServiceProducerSK.cpp LogServiceConsumerSK.cpp LogServiceAdministratorSK.cpp LogServiceSK.cpp cfSK.cpp 3 LIBS = -lomniORB4 4 4 INCLUDE = -I. 5 5 -
platform/logService/main.cpp
r3732 r3743 1 1 #include "Log_impl.h" 2 #include " ossie/cf.h"2 #include "cf.h" 3 3 4 4 #include <iostream> … … 24 24 Log_impl* log_servant = new Log_impl(1000); 25 25 PortableServer::ObjectId_var log_id = poa->activate_object(log_servant); 26 CosLwLog::Log_var log_var = log_servant->_this();26 LogService::Log_ptr log_ptr = log_servant->_this(); 27 27 28 28 CosNaming::Name_var cosName = rootContext->to_name("DomainName1/Log"); 29 rootContext->rebind(cosName, log_ var);29 rootContext->rebind(cosName, log_ptr); 30 30 31 31 PortableServer::POAManager_var pman = poa->the_POAManager(); … … 58 58 59 59 std::cout << "Calling registerService on DeviceaManager" << std::endl; 60 deviceManager->registerService(log_var, "Log"); 60 deviceManager->registerService(log_ptr, "Log"); 61 std::cout << "Service registered" << std::endl; 62 63 std::cout << orb->object_to_string(log_ptr) << std::endl; 61 64 62 65 //