| 256 | } |
| 257 | |
| 258 | void* stream::get_ctx(const char* key /* = NULL */) const |
| 259 | { |
| 260 | if (key == NULL || *key == 0) { |
| 261 | return default_ctx_; |
| 262 | } |
| 263 | if (ctx_table_ == NULL) { |
| 264 | return NULL; |
| 265 | } |
| 266 | std::map<string, void*>::const_iterator it = ctx_table_->find(key); |
| 267 | if (it != ctx_table_->end()) { |
| 268 | return it->second; |
| 269 | } else { |
| 270 | return NULL; |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | void* stream::del_ctx(const char* key /* = NULL */) |
| 275 | { |
no test coverage detected