diff options
author | Determinant <[email protected]> | 2015-06-22 19:01:29 +0800 |
---|---|---|
committer | Determinant <[email protected]> | 2015-06-22 19:01:29 +0800 |
commit | 2497fd9e7a0fae5ee4887890d7a312e0e08a93b8 (patch) | |
tree | 382f97575bd2df9ee6abb1662b11b279fc22d72b /io/init.lua | |
parent | 196e9b48a3541caccdffc5743001cced70667091 (diff) |
major change: use luarocks to manage project
Diffstat (limited to 'io/init.lua')
-rw-r--r-- | io/init.lua | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/io/init.lua b/io/init.lua deleted file mode 100644 index b722a81..0000000 --- a/io/init.lua +++ /dev/null @@ -1,55 +0,0 @@ -function nerv.ChunkFile:write_chunkdata(metadata, writer) - if type(metadata) ~= "table" then - nerv.error("metadata should be a Lua table") - return - end - return self:_write_chunkdata(table.tostring(metadata), writer) -end - -function nerv.ChunkFile:write_chunk(chunk) - local id = chunk.id - local type = chunk.__typename - if id == nil then - nerv.error("id of chunk %s must be specified", type) - end - self:write_chunkdata({id = id, - type = type, - info = chunk:get_info()}, chunk) -end - -function nerv.ChunkFile:read_chunk(id, global_conf) - if self.metadata == nil then - nerv.error("wrong file opening mode") - end - local metadata = self.metadata[id] - if metadata == nil then - nerv.error("chunk with id %s does not exist", id) - end - local chunk_type = nerv.get_type(metadata.type) - local chunk = chunk_type(id, global_conf) - chunk:set_info(metadata.info) - chunk:read(self:get_chunkdata(id)) - return chunk -end - -local DataReader = nerv.class("nerv.DataReader") - -function DataReader:__init(global_conf, reader_conf) - nerv.error_method_not_implemented() -end - -function DataReader:get_data() - nerv.error_method_not_implemented() -end - -local DataBuffer = nerv.class("nerv.DataBuffer") - -function DataBuffer:__init(global_conf, buffer_conf) - nerv.error_method_not_implemented() -end - -function DataBuffer:get_batch() - nerv.error_method_not_implemented() -end - -require 'io.sgd_buffer' |