Changeset 3574

Show
Ignore:
Timestamp:
05/01/07 19:12:56 (6 years ago)
Author:
ttsou
Message:

changed default constructors

Location:
platform/logService
Files:
12 modified

Legend:

Unmodified
Added
Removed
  • platform/logService/LogAdministrator_impl.cpp

    r3537 r3574  
    11#include "LogAdministrator_impl.h" 
    22 
    3 LogAdministrator_impl::LogAdministrator_impl() :  
    4     LogStatus_impl() 
     3LogAdministrator_impl::LogAdministrator_impl() 
     4{ 
     5 
     6} 
     7 
     8LogAdministrator_impl::LogAdministrator_impl(unsigned long long max_length) :  
     9    LogStatus_impl(max_length) 
    510{ 
    611     
     
    2631        // Set flags 
    2732    }    
    28     
    29  
    3033} 
    3134 
     
    5154void LogAdministrator_impl::destroy() 
    5255{ 
    53     // Removes sequence. Undefined behavior. 
     56    // Deletes log. Undefined behavior.  
    5457    test_mutex->acquire(); 
    5558    delete log_record_sequence; 
  • platform/logService/LogAdministrator_impl.h

    r3486 r3574  
    1414public: 
    1515    LogAdministrator_impl(); 
     16    LogAdministrator_impl(unsigned long long max_length); 
    1617    ~LogAdministrator_impl(); 
    1718 
  • platform/logService/LogConsumer_impl.cpp

    r3571 r3574  
    11#include "LogConsumer_impl.h" 
    22 
    3 LogConsumer_impl::LogConsumer_impl() : LogStatus_impl() 
     3LogConsumer_impl::LogConsumer_impl() 
     4{ 
     5 
     6} 
     7 
     8LogConsumer_impl::LogConsumer_impl(unsigned long long max_length) : 
     9    LogStatus_impl(max_length) 
    410{ 
    511 
     
    1420LogConsumer_impl::get_record_id_from_time(const CosLwLog::LogTime& fromTime) 
    1521{ 
    16    return 0; 
     22    // There is currently no time 
     23    return 0; 
    1724} 
    1825 
     
    2128    howMany) 
    2229{ 
    23     // Return pointer is callers responsibilty to deallocate 
     30    // Return pointer is callers responsibilty to deallocate? 
    2431    CosLwLog::LogRecordSequence* return_sequence; 
    2532 
    2633    test_mutex->acquire(); 
    2734 
     35    // Possibly change this create the new sequence with the data constructor 
    2836    return_sequence = new CosLwLog::LogRecordSequence(*log_record_sequence); 
    2937    return_sequence->length(log_record_size); 
  • platform/logService/LogConsumer_impl.h

    r3486 r3574  
    1414public: 
    1515    LogConsumer_impl(); 
     16    LogConsumer_impl(unsigned long long max_length); 
    1617    ~LogConsumer_impl(); 
    1718 
  • platform/logService/LogProducer_impl.cpp

    r3536 r3574  
    33#include <iostream> 
    44 
    5 LogProducer_impl::LogProducer_impl() : LogStatus_impl() 
     5LogProducer_impl::LogProducer_impl() 
     6{ 
     7 
     8} 
     9 
     10LogProducer_impl::LogProducer_impl(unsigned long long max_length) :  
     11    LogStatus_impl(max_length) 
    612{ 
    713 
  • platform/logService/LogProducer_impl.h

    r3486 r3574  
    1313public: 
    1414    LogProducer_impl(); 
     15    LogProducer_impl(unsigned long long max_length); 
    1516    ~LogProducer_impl(); 
    1617 
  • platform/logService/LogStatus_impl.cpp

    r3571 r3574  
    55LogStatus_impl::LogStatus_impl() 
    66{ 
     7    std::cout << "Default constructor called" << std::endl; 
     8 
     9    LogStatus_impl::LogStatus_impl(MAX_SIZE_DEFAULT); 
     10} 
     11 
     12LogStatus_impl::LogStatus_impl(unsigned long long max_size) 
     13{ 
     14    std::cout << "Other constructor called" << std::endl; 
     15 
    716    test_mutex = new omni_mutex(); 
    817    test_mutex->release(); 
    918 
    1019    log_record_size = 0; 
    11     log_record_max_size = 1000; 
     20    log_record_max_size = max_size; 
    1221 
    1322    log_record_sequence = new CosLwLog::LogRecordSequence(); 
    14     log_record_sequence->length(log_record_max_size); 
     23    log_record_sequence->length(max_size); 
    1524 
    1625    operational_state = CosLwLog::disabled; 
     
    2433LogStatus_impl::~LogStatus_impl() 
    2534{ 
     35    // Wait for existing r/w to complete 
     36    // Administrator can also delete sequence, behavior undefined  
     37    test_mutex->acquire(); 
     38    delete log_record_sequence; 
     39    delete test_mutex; 
    2640 
    2741} 
     
    4155unsigned long long LogStatus_impl::get_n_records() 
    4256{ 
    43     // See what this does 
     57    // Figure what this should do 
    4458    return 0; 
    4559} 
  • platform/logService/LogStatus_impl.h

    r3534 r3574  
    11#include "CosLwLogStatus.h" 
     2 
     3#define MAX_SIZE_DEFAULT 1000 
    24 
    35class LogStatus_impl : public virtual POA_CosLwLog::LogStatus 
     
    2022public: 
    2123    LogStatus_impl(); 
     24    LogStatus_impl(unsigned long long max_length); 
    2225    ~LogStatus_impl(); 
    2326 
  • platform/logService/Log_impl.cpp

    r3486 r3574  
    11#include "Log_impl.h" 
    22 
    3 Log_impl::Log_impl() 
     3Log_impl::Log_impl(unsigned long long max_length) : 
     4    LogStatus_impl(max_length) 
    45{ 
    56 
  • platform/logService/Log_impl.h

    r3486 r3574  
    1010                  public LogConsumer_impl 
    1111{ 
    12     Log_impl(); 
     12    Log_impl(unsigned long long max_length); 
    1313    ~Log_impl();  
    1414}; 
  • platform/logService/Makefile

    r3486 r3574  
    11CFLAGS = -Wall 
    22SOURCES = 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.cpp 
    3 LIBS = -lomniORB4 -lossieparser -lossiecf -lossieidl 
     3LIBS = -lomniORB4 
    44INCLUDE = -I. 
    55 
  • platform/logService/main.cpp

    r3571 r3574  
    1818    rootContext = CosNaming::NamingContextExt::_narrow(initServ); 
    1919  
    20     Log_impl* log_servant = new Log_impl(); 
     20    Log_impl* log_servant = new Log_impl(1000); 
    2121    PortableServer::ObjectId_var log_id = poa->activate_object(log_servant); 
    2222    CosLwLog::Log_var log_var = log_servant->_this();