ELASTICPATHING/SOURCECODE/UbiComp2014/Elastic_Pathing_Code/lib-NodeWay.rb
#A container class for the Node_sql and Node_buffer class
#This class unifies the interface and checks the buffer before the sql. This is the only class that should actually be instantiated
A container class for the Node_sql and Node_buffer class
This class unifies the interface and checks the buffer before the sql. This is the only class that should actually be instantiated
A container class for the Node_sql and Node_buffer class This class unifies the interface and checks the buffer before the sql . This is the only class that should actually be instantiated
def fill_buffer(tdb)
		fill = Array.new()
		tdb.results_as_hash = true unless tdb.results_as_hash
		tdb.execute("SELECT * FROM gnodes"){|r| fill.push([r['id'].to_i,r['latitude'].to_f,r['longitude'].to_f])}
		@node_buffer.fill_buffer(fill)
	end
def fill_buffer ( tdb ) fill = Array . new ( ) tdb . results_as_hash = true unless tdb . results_as_hash tdb . execute ( "SELECT * FROM gnodes" ) { | r | fill . push ( [ r [ 'id' ] . to_i , r [ 'latitude' ] . to_f , r [ 'longitude' ] . to_f ] ) } @node_buffer . fill_buffer ( fill ) end
A container class for the Node_sql and Node_buffer class
This class unifies the interface and checks the buffer before the sql.
A container class for the Node_sql and Node_buffer class This class unifies the interface and checks the buffer before the sql .
#tdb is a sqllite object (SQLite3::Database.new), populates the buffer with values from the database
tdb