#include <source_location.hh>
Inheritance diagram for lestes::std::source_location:

Public Member Functions | |
| ptr< file_info > | file_get (void) const |
| Returns file information. | |
| ulint | line_get (void) const |
| Returns line in file. | |
| ulint | column_get (void) const |
| Returns column on line. | |
| ulint | order_get (void) const |
| Returns order. | |
| bool | equals (const ptr< source_location > &rhs) const |
| Tests equality. | |
| ptr< source_location > | clone_order (ulint a_order) const |
| Clones location with new order. | |
| ptr< source_location > | clone_file (const ptr< file_info > &a_file) const |
| Clones location with new file information. | |
| virtual ptr< reflection_list > | reflection_get (void) const |
| Returns list of reflection info. | |
| virtual ptr< field_list_list > | field_values_get (void) const |
| Returns list of field values. | |
Static Public Member Functions | |
| static ptr< source_location > | create (const ptr< file_info > &a_file, ulint a_line, ulint a_column) |
| Returns new location, initializes with file information and position. | |
| static ptr< source_location > | create (const ptr< file_info > &a_file, ulint a_line, ulint a_column, ulint a_order) |
| Returns new location, initializes with file information, position and order. | |
| static ptr< source_location > | zero (void) |
| Returns zero location. | |
Protected Member Functions | |
| source_location (const ptr< file_info > &a_file, ulint a_line, ulint a_column, ulint a_order) | |
| Creates new object, initializes with file information, postion and order. | |
| void | gc_mark () |
| Marking routine. | |
Private Member Functions | |
| source_location (const source_location &) | |
| Hides copy constructor. | |
| source_location & | operator= (const source_location &) |
| Hides assigment operator. | |
Private Attributes | |
| srp< file_info > | file |
| File information structure. | |
| ulint | line |
| Line in file. | |
| ulint | column |
| Column inside the line. | |
| ulint | order |
| The order in the translation unit. | |
Static Private Attributes | |
| static ptr< source_location > | zero_instance = zero_instance |
| Zero location instance. | |
| static ptr< reflection_list > | reflection = reflection |
| The reflection information. | |
Definition at line 48 of file source_location.hh.
| lestes::std::source_location::source_location | ( | const ptr< file_info > & | a_file, | |
| ulint | a_line, | |||
| ulint | a_column, | |||
| ulint | a_order | |||
| ) | [protected] |
Creates new object, initializes with file information, postion and order.
Creates new object, initializes with file information and position.
| a_file | The file information. | |
| a_line | The line in the file. | |
| a_column | The column on the line. | |
| a_order | The order in the translation unit. |
Definition at line 55 of file source_location.cc.
Referenced by clone_file(), clone_order(), create(), and zero().
00056 : 00057 file((lassert(a_file), a_file)), 00058 line(a_line), 00059 column(a_column), 00060 order(a_order) 00061 { 00062 }
| lestes::std::source_location::source_location | ( | const source_location & | ) | [private] |
Hides copy constructor.
Returns file information.
Returns file information.
Definition at line 77 of file source_location.cc.
References file.
Referenced by clone_order(), and field_values_get().
00078 { 00079 return file; 00080 }
| ulint lestes::std::source_location::line_get | ( | void | ) | const |
Returns line in file.
Returns position in the file.
Definition at line 86 of file source_location.cc.
References line.
Referenced by clone_file(), clone_order(), and field_values_get().
00087 { 00088 return line; 00089 }
| ulint lestes::std::source_location::column_get | ( | void | ) | const |
Returns column on line.
Returns position on the line.
Definition at line 95 of file source_location.cc.
References column.
Referenced by clone_file(), clone_order(), and field_values_get().
00096 { 00097 return column; 00098 }
| ulint lestes::std::source_location::order_get | ( | void | ) | const |
Returns order.
Returns order in translation unit.
Definition at line 115 of file source_location.cc.
References order.
Referenced by clone_file(), and field_values_get().
00116 { 00117 return order; 00118 }
| bool lestes::std::source_location::equals | ( | const ptr< source_location > & | rhs | ) | const |
Tests equality.
Tests equality to other source_location.
| rhs | The location to compare to. |
Definition at line 104 of file source_location.cc.
References column, file, lestes::is_equal(), and line.
00105 { 00106 return rhs && is_equal(file,rhs->file_get()) && 00107 is_equal(line,rhs->line_get()) && 00108 is_equal(column,rhs->column_get()); 00109 }
| ptr< source_location > lestes::std::source_location::clone_order | ( | ulint | a_order | ) | const |
Clones location with new order.
Clones the location with new order.
| a_order | The order for the new location. |
Definition at line 125 of file source_location.cc.
References column_get(), file_get(), line_get(), and source_location().
00126 { 00127 return new source_location(file_get(),line_get(),column_get(),a_order); 00128 }
| ptr< source_location > lestes::std::source_location::clone_file | ( | const ptr< file_info > & | a_file | ) | const |
Clones location with new file information.
Clones the location with new file information.
| a_file | The file_information for the new location. |
Definition at line 135 of file source_location.cc.
References column_get(), line_get(), order_get(), and source_location().
00136 { 00137 return new source_location(a_file,line_get(),column_get(),order_get()); 00138 }
| ptr< source_location > lestes::std::source_location::create | ( | const ptr< file_info > & | a_file, | |
| ulint | a_line, | |||
| ulint | a_column | |||
| ) | [static] |
Returns new location, initializes with file information and position.
Returns new instance, initializes with file information and position.
| a_file | The file information. | |
| a_line | The line in the file. | |
| a_column | The column on the line. |
Definition at line 148 of file source_location.cc.
References source_location().
00150 { 00151 return new source_location(a_file,a_line,a_column,0); 00152 }
| ptr< source_location > lestes::std::source_location::create | ( | const ptr< file_info > & | a_file, | |
| ulint | a_line, | |||
| ulint | a_column, | |||
| ulint | a_order | |||
| ) | [static] |
Returns new location, initializes with file information, position and order.
Returns new instance, initializes with file information, position and order.
| a_file | The file information. | |
| a_line | The line in the file. | |
| a_column | The column on the line. | |
| a_order | The order in the translation unit. |
Definition at line 163 of file source_location.cc.
References source_location().
00165 { 00166 return new source_location(a_file,a_line,a_column,a_order); 00167 }
| ptr< source_location > lestes::std::source_location::zero | ( | void | ) | [static] |
Returns zero location.
Returns location at the beginning of the translation unit.
Definition at line 173 of file source_location.cc.
References lestes::std::file_info::create(), source_location(), and zero_instance.
00174 { 00175 if (!zero_instance) { 00176 zero_instance = new source_location(file_info::create("<internal>",NULL),1,1,0); 00177 } 00178 return zero_instance; 00179 }
| ptr< object::reflection_list > lestes::std::source_location::reflection_get | ( | void | ) | const [virtual] |
Returns list of reflection info.
Returns reflection list for source location.
Reimplemented from lestes::std::object.
Definition at line 185 of file source_location.cc.
References lestes::std::class_reflection::create(), lestes::std::list< T >::create(), reflection, and lestes::std::object::reflection_get().
00186 { 00187 if (!reflection) { 00188 typedef class_reflection::field_metadata md; 00189 typedef class_reflection::field_metadata_list mdlist; 00190 ptr<mdlist> mdl = mdlist::create(); 00191 mdl->push_back(md::create("file","lstring")); 00192 mdl->push_back(md::create("line","ulint")); 00193 mdl->push_back(md::create("column","ulint")); 00194 mdl->push_back(md::create("order","ulint")); 00195 reflection = reflection_list::create(object::reflection_get()); 00196 reflection->push_back(class_reflection::create("source_location",mdl)); 00197 } 00198 return reflection; 00199 }
| ptr< object::field_list_list > lestes::std::source_location::field_values_get | ( | void | ) | const [virtual] |
Returns list of field values.
Returns values of the fields.
Reimplemented from lestes::std::object.
Definition at line 205 of file source_location.cc.
References column_get(), lestes::std::list< T >::create(), lestes::std::object::field_values_get(), file_get(), line_get(), and order_get().
00206 { 00207 ptr<field_list_list> result = object::field_values_get(); 00208 result->push_back(value_list::create()); 00209 result->back()->push_back(objectize<lstring>::create(file_get()->name_get())); 00210 result->push_back(value_list::create()); 00211 result->back()->push_back(objectize<ulint>::create(line_get())); 00212 result->push_back(value_list::create()); 00213 result->back()->push_back(objectize<ulint>::create(column_get())); 00214 result->push_back(value_list::create()); 00215 result->back()->push_back(objectize<ulint>::create(order_get())); 00216 return result; 00217 }
| void lestes::std::source_location::gc_mark | ( | void | ) | [protected, virtual] |
Marking routine.
Standard marking routine, called by the garbage collector.
Reimplemented from lestes::std::mem::keystone.
Definition at line 67 of file source_location.cc.
References file, lestes::std::mem::keystone::gc_mark(), and lestes::std::mem::simple_pointer::gc_mark().
00068 { 00069 file.gc_mark(); 00070 object::gc_mark(); 00071 }
| source_location& lestes::std::source_location::operator= | ( | const source_location & | ) | [private] |
Hides assigment operator.
srp<file_info> lestes::std::source_location::file [private] |
File information structure.
Definition at line 84 of file source_location.hh.
Referenced by equals(), file_get(), and gc_mark().
ulint lestes::std::source_location::line [private] |
Line in file.
Definition at line 86 of file source_location.hh.
Referenced by equals(), and line_get().
ulint lestes::std::source_location::column [private] |
Column inside the line.
Definition at line 88 of file source_location.hh.
Referenced by column_get(), and equals().
ulint lestes::std::source_location::order [private] |
The order in the translation unit.
Definition at line 90 of file source_location.hh.
Referenced by order_get().
ptr< source_location > lestes::std::source_location::zero_instance = zero_instance [static, private] |
Zero location instance.
The zero location instance at the beginning of the translation unit.
Definition at line 92 of file source_location.hh.
Referenced by zero().
ptr< object::reflection_list > lestes::std::source_location::reflection = reflection [static, private] |
The reflection information.
Reflection list for source location.
Reimplemented from lestes::std::object.
Definition at line 94 of file source_location.hh.
Referenced by reflection_get().
1.5.1-20070107