Logo Search packages:      
Sourcecode: maxdb-7.5.00 version File versions

DBMCli_Devspace & DBMCli_Devspaces::NewDevspace ( const DBMCli_String sClass  ) 

------------------------------------------------------------------------- function: NewDevspace ------------------------------------------------------------------------- description: A new devspace. arguments: sClass [OUT] - class of devspace return value: Reference to a devspace object. -------------------------------------------------------------------------

Definition at line 914 of file DBMCli_Devspace.cpp.

References ClassFromClassName(), DBMCli_Array< TYPE, ARG_TYPE >::GetSize(), DBMCli_Devspace::SetDatabase(), and DBMCli_Devspace::SetProperties().

{
  DBMCli_DevspaceClass nClass;
  SAPDB_Bool bFound = false;
  SAPDB_Int nDevspace;
  SAPDB_Int nNextNum;

  nClass = ClassFromClassName( sClass );

  switch( nClass ) {
    case DBMCLI_DEVSPACECLASS_DATA:
      nNextNum = m_nUsedDataDevs + 1;
      break;
    case DBMCLI_DEVSPACECLASS_LOG:
      nNextNum = m_nUsedLogDevs + 1;
      break;
    default:
      nNextNum = 0;
      break;
  }

  m_oNewDevspace.SetDatabase( m_pDatabase );

  nDevspace = m_aDevspace.GetSize( ) - 1;
  while( ( nDevspace >= 0 ) && ( bFound == false ) ) {
    if( m_aDevspace[nDevspace].Class( ) == nClass ) {
      bFound = true;
    } else {
      nDevspace--;
    }
  }

  if( bFound ) {
    m_oNewDevspace.SetProperties( nClass, 
                                  nNextNum, 
                                  m_aDevspace[nDevspace].Pages( ), 
                                  GetNextLocation( m_aDevspace[nDevspace].Location( ) ),
                                  m_aDevspace[nDevspace].Type( ),
                                  m_aDevspace[nDevspace].Mirrored( ),
                                  GetNextLocation( m_aDevspace[nDevspace].MirroredLocation( ) ),
                                  m_aDevspace[nDevspace].MirroredType( ) );
  } else {
    m_oNewDevspace.SetProperties( nClass, nNextNum);
  }


  return m_oNewDevspace;
}


Generated by  Doxygen 1.6.0   Back to index