--- parser3/src/classes/response.C 2001/04/27 15:19:23 1.7.4.1 +++ parser3/src/classes/response.C 2003/01/21 15:51:07 1.23 @@ -1,42 +1,35 @@ /** @file Parser: @b response parser class. - Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) - - Author: Alexander Petrosyan (http://design.ru/paf) - - $Id: response.C,v 1.7.4.1 2001/04/27 15:19:23 paf Exp $ + Copyright (c) 2001, 2003 ArtLebedev Group (http://www.artlebedev.com) + Author: Alexandr Petrosian (http://paf.design.ru) */ +static const char* IDENT_RESPONSE_C="$Date: 2003/01/21 15:51:07 $"; + #include "classes.h" #include "pa_request.h" -// defines - -#define RESPONSE_CLASS_NAME "response" - // class class MResponse : public Methoded { public: MResponse(Pool& pool); - bool used_directly() { return true; } +public: // Methoded + bool used_directly() { return false; } }; // methods -static void _clear(Request& r, const String&, MethodParams *) { - r.self/*VResponse*/->get_hash()/*sure not 0*/->clear(); +static void _clear(Request& r, const String& method_name, MethodParams *) { + r.get_self()/*VResponse*/->get_hash(&method_name)/*sure not 0*/->clear(); } // constructor -MResponse::MResponse(Pool& pool, VStateless_class& vclass) { - set_name(new(pool) String(pool, RESPONSE_CLASS_NAME)); - - +MResponse::MResponse(Pool& apool) : Methoded(apool, "response") { // ^clear[] - vclass.add_native_method("clear", Method::CT_DYNAMIC, _clear, 0, 0); + add_native_method("clear", Method::CT_DYNAMIC, _clear, 0, 0); } // global variable @@ -44,6 +37,6 @@ Methoded *response_class; // creator -Methoded *MTable_create(Pool& pool) { +Methoded *MResponse_create(Pool& pool) { return response_class=new(pool) MResponse(pool); }