c++/EEDB/Tools/OSCFileParser.cpp
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// dynamic fetch/creation of sources as needed 
// related to BED style subfeature blocks
//
dynamic fetch/creation of sources as needed
related to BED style subfeature blocks
dynamic fetch / creation of sources as needed related to BED style subfeature blocks
EEDB::FeatureSource*  EEDB::Tools::OSCFileParser::primary_feature_source() {
  if(_primary_feature_source != NULL) { return _primary_feature_source; }
  if(!_peer) {
    _peer = new EEDB::Peer();
    _peer->create_uuid();
  }
  _primary_feature_source = new EEDB::FeatureSource();
  _data_sources.push_back(_primary_feature_source);
  _primary_feature_source->peer_uuid(_peer->uuid());
  _primary_feature_source->primary_id(1);
  _primary_feature_source->create_date(time(NULL));
  if(_parameters.find("_fsrc_name") != _parameters.end()) {
    _primary_feature_source->name(_parameters["_fsrc_name"]);    
  }
  else if(_parameters.find("display_name") != _parameters.end()) {
    _primary_feature_source->name(_parameters["display_name"]);    
  }
  if(_parameters.find("_fsrc_category") != _parameters.end()) {
    _primary_feature_source->category(_parameters["_fsrc_category"]);    
  }
  if(_parameters.find("_owner_identity") != _parameters.end()) {
    _primary_feature_source->owner_identity(_parameters["_owner_identity"]);    
  }
  _transfer_parameters_to_source(_primary_feature_source);
  EEDB::DataSource::add_to_sources_cache(_primary_feature_source);
  return _primary_feature_source;
}
EEDB :: FeatureSource * EEDB :: Tools :: OSCFileParser :: primary_feature_source ( ) { if ( _primary_feature_source != NULL ) { return _primary_feature_source ; } if ( ! _peer ) { _peer = new EEDB :: Peer ( ) ; _peer -> create_uuid ( ) ; } _primary_feature_source = new EEDB :: FeatureSource ( ) ; _data_sources . push_back ( _primary_feature_source ) ; _primary_feature_source -> peer_uuid ( _peer -> uuid ( ) ) ; _primary_feature_source -> primary_id ( 1 ) ; _primary_feature_source -> create_date ( time ( NULL ) ) ; if ( _parameters . find ( " " ) != _parameters . end ( ) ) { _primary_feature_source -> name ( _parameters [ " " ] ) ; } else if ( _parameters . find ( " " ) != _parameters . end ( ) ) { _primary_feature_source -> name ( _parameters [ " " ] ) ; } if ( _parameters . find ( " " ) != _parameters . end ( ) ) { _primary_feature_source -> category ( _parameters [ " " ] ) ; } if ( _parameters . find ( " " ) != _parameters . end ( ) ) { _primary_feature_source -> owner_identity ( _parameters [ " " ] ) ; } _transfer_parameters_to_source ( _primary_feature_source ) ; EEDB :: DataSource :: add_to_sources_cache ( _primary_feature_source ) ; return _primary_feature_source ; }
dynamic fetch/creation of sources as needed
related to BED style subfeature blocks
dynamic fetch / creation of sources as needed related to BED style subfeature blocks
//not set this is part of creation process //$fsrc->import_source($self->{'_inputfile'}); //$fsrc->import_date(scalar(gmtime()) . " GMT"); //add to the global sources cache //fprintf(stderr, "OSCFileParser created primary source %s\n", _primary_feature_source->xml().c_str());