Telefónica I+D 20 SAMSON Module example… Module simple_mobility { title Simple mobility example author Andreu Urruela version 0.1.1 } data UserArea { system.String name; system.UInt x; system.UInt y; system.UInt radius; } data Position { system.UInt x; system.UInt y; system.TimeUnix time; } … parser parser_cdrs { out system.UInt simple_mobility.Position helpLine Parse input CDRs to get user-position } class parser_cdrs : public samson::system::SimpleParser { std::vector words; // Vector used to store words parsed at each line void parseLine( char * line, samson::KVWriter *writer ) { // Split line in words split_in_words( line, words ); // Expected format USER_ID CDR X Y time if( words.size() < 5 ) return; // No content for a valid instruction if( strcmp( words[1], CDR ) != 0 ) return; // Non valid format // Set the key key.value = atoll( words[0] ); // Set the position value.set( atoll( words[2] ), atoll( words[3] ), atoll( words[4] ) ); // Emit the key-value writer->emit( 0, &key, &value ); } }; module