コード例 #1
0
start_location *start_location::find( const std::string ident ) {
    location_map::iterator found = _locations.find( ident );
    if(found != _locations.end()){
        return &(found->second);
    } else {
        debugmsg("Tried to get invalid location: %s", ident.c_str());
        static start_location null_location;
        return &null_location;
    }
}
コード例 #2
0
const start_location &string_id<start_location>::obj() const
{
    const auto iter = _locations.find( *this );
    if( iter != _locations.end() ) {
        return iter->second;
    } else {
        debugmsg( "Tried to get invalid start location: %s", c_str() );
        static const start_location dummy{};
        return dummy;
    }
}
コード例 #3
0
location_map::iterator start_location::end()
{
    return _locations.end();
}
コード例 #4
0
location_map::iterator start_location::begin()
{
    return _locations.begin();
}
コード例 #5
0
void start_location::reset()
{
    _locations.clear();
}
コード例 #6
0
bool string_id<start_location>::is_valid() const
{
    return _locations.count( *this ) > 0;
}