//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project/CC
//
//File: triggerbase.cpp
//
//Version: $Revision: 1.5 $
//
//State: $State: Exp $
//
//Date: $Date: 1998/11/12 15:10:06 $
//
//Organisation:
//      University of Technology
// 
//Author:
//      Pasi Nummisalo
//
//Description:
//     
//
//Copyright:
//     University of Technology
//     Laboratory of Telecommunications and Multimedia 
//      
//Licence:
//     
//
//History:
//

//
//Functions: set/get category (string form)
//
//Description:
//   
//

#include "triggerbase.h"


ccTriggerBase :: ccTriggerBase(void)
{
    return;
}

ccTriggerBase :: ~ccTriggerBase(void)
{
    return;
}

void ccTriggerBase :: setCategory(string category_)
{
    _category = toveinap_officeBased;
    
    if (category_ == getGroupCategoryString())
    {
        _category = toveinap_groupBased;
    }
    else if (category_ == getOfficeCategoryString())
    {
        _category = toveinap_officeBased;
    }
    
    return;
}

string ccTriggerBase :: getCategory(void) const
{
    string result;
  
    if (_category == toveinap_groupBased)
    {
        result = getGroupCategoryString();
    }
    else if (_category == toveinap_officeBased)
    {
        result = getOfficeCategoryString();
    }
   
    return result;
}

//
//Function: geInapCategory
//
//Description:
//   Get category (inap form)
//

toveinap_DPAssignmentType ccTriggerBase :: getInapCategory(void) const
{
    return _category;
}

//
//Functions: String presentation for different categories
//
//Description:
// 
//

string ccTriggerBase :: getOfficeCategoryString(void)
{
    string office("Office");
    return office;
}

string ccTriggerBase :: getGroupCategoryString(void)
{
    string group("Group");
    return group;
}

//
//Functions: methods for reference counter
//
//Description:
//    Implements methods to increment and decrement the value of
//    reference counter
//

void ccTriggerBase :: incRefCount(void)
{
    _refCount++;
    return;
}

void ccTriggerBase :: decRefCount(void)
{
    _refCount--;
    return;
}

//
//Function: noReference
//
//Description:
//    Tell is there any reference to implementation
//

int ccTriggerBase :: noReference(void) const
{
    int reference = 0;
    if (_refCount == 0)
    {
        reference = 1;
    }
    else
    {
        reference = 0;
    }
    return reference;
}

//
//Functions: serviceKey
//
//Description:
//   
//

void ccTriggerBase :: setServiceKey(toveinap_ServiceKeyType serviceKey_)
{
    _serviceKey = serviceKey_;
    return;
}

toveinap_ServiceKeyType ccTriggerBase :: getServiceKey(void) const
{
    return _serviceKey;
}

//
//Functions: applicationContext
//
//Description:
//   
//

void ccTriggerBase :: setApplicationContext(string context_)
{
    _applicationContext = context_;
    return;
}

string ccTriggerBase :: getApplicationContext(void) const
{
    return _applicationContext;
}

//
//Functions: address
//
//Description:
//   
//

void ccTriggerBase :: setAddress(string address_)
{
    _address = address_;
    return;
}

string ccTriggerBase :: getAddress(void) const
{
    return _address;
}




