SASC-NG
DVBSoftCAM

cSystemLinkCardClient Class Reference

Inheritance diagram for cSystemLinkCardClient:

List of all members.

Public Member Functions

 cSystemLinkCardClient (void)
virtual bool CanHandle (unsigned short SysId)
virtual cSystem * Create (void)
virtual void Clean (void)
cCardClient * FindBySysId (unsigned short id, cCardClient *cc)

Protected Member Functions

virtual bool ParseLinePlain (const char *line)

Detailed Description

Definition at line 177 of file cc.c.


Constructor & Destructor Documentation

cSystemLinkCardClient::cSystemLinkCardClient ( void  )

Definition at line 251 of file cc.c.

References cOpts::Add(), immediate, cSystemLink::opts, SYSTEM_NAME, and trNOOP.

:cSystemLink(SYSTEM_NAME,SYSTEM_PRI)
,cStructListPlain<cCardClient>("cardclient config",CONF_FILE,SL_MISSINGOK|SL_VERBOSE|SL_NOPURGE)
{
  opts=new cOpts(SYSTEM_NAME,1);
  opts->Add(new cOptBool("Immediate",trNOOP("Cardclient: connect immediately"),&immediate));
}

Member Function Documentation

bool cSystemLinkCardClient::CanHandle ( unsigned short  SysId) [virtual]

Implements cSystemLink.

Definition at line 268 of file cc.c.

References FindBySysId().

{
  return FindBySysId(SysId,0)!=0;
}
void cSystemLinkCardClient::Clean ( void  ) [virtual]

Reimplemented from cSystemLink.

Definition at line 305 of file cc.c.

References cStructLoader::SafeClear().

{
  SafeClear();
}
cSystem * cSystemLinkCardClient::Create ( void  ) [virtual]

Implements cSystemLink.

Definition at line 273 of file cc.c.

{
  return new cSystemCardClient();
}
cCardClient * cSystemLinkCardClient::FindBySysId ( unsigned short  id,
cCardClient *  cc 
)
bool cSystemLinkCardClient::ParseLinePlain ( const char *  line) [protected, virtual]

Implements cStructLoaderPlain.

Definition at line 278 of file cc.c.

References cSimpleListBase::Add(), cCardClientLink::Create(), cCardClients::FindByName(), cCardClient::Immediate(), cCardClient::Init(), L_CC_CORE, L_GEN_ERROR, cCardClient::Login(), cCardClient::Name(), cSystemLink::name, and PRINTF.

{
  char name[32];
  int num;
  if(sscanf(line,"%31[^:]:%n",name,&num)==1) {
    cCardClientLink *ccl=cardclients.FindByName(name);
    if(ccl) {
      cCardClient *cc=ccl->Create();
      if(cc) {
        if(cc->Init(&line[num])) {
          Add(cc);
          PRINTF(L_CC_CORE,"client '%s' ready",cc->Name());
          if(cc->Immediate()) cc->Login();
          return true;
          }
        else {
          delete cc;
          PRINTF(L_GEN_ERROR,"init of cardclient '%s' failed",name);
          }
        }
      else PRINTF(L_GEN_ERROR,"failed to create cardclient '%s'",name);
      }
    else PRINTF(L_GEN_ERROR,"no client found for card server type '%s'",name);
    }
  return false;
}

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines