Class: IDL::AST::Operation
- Defined in:
- lib/ridl/node.rb,
lib/ridl/node.rb
Overview
Parameter
Constant Summary collapse
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
-
#idltype ⇒ Object
readonly
Returns the value of attribute idltype.
-
#oneway ⇒ Object
readonly
Returns the value of attribute oneway.
-
#raises ⇒ Object
Returns the value of attribute raises.
Attributes inherited from Leaf
#annotations, #enclosure, #intern, #lm_name, #name, #prefix, #scopes
Instance Method Summary collapse
- #define(*args) ⇒ Object
- #in_params ⇒ Object
-
#initialize(_name, _enclosure, params) ⇒ Operation
constructor
A new instance of Operation.
- #instantiate(_context, _enclosure) ⇒ Object
- #marshal_dump ⇒ Object
- #marshal_load(vars) ⇒ Object
- #out_params ⇒ Object
- #params ⇒ Object
Methods inherited from Node
#introduce, #is_definable?, #match_members, #redefine, #replace_prefix, #resolve, #undo_introduction, #walk_members
Methods inherited from Leaf
#_set_prefix, #has_annotations?, #is_local?, #is_template?, #lm_name_for_scope, #parsed_name_scope, #replace_prefix, #repo_scopes, #repository_id, #resolve, #scoped_lm_name, #scoped_name, #set_repo_id, #set_repo_version, #typename
Constructor Details
#initialize(_name, _enclosure, params) ⇒ Operation
Returns a new instance of Operation.
2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 |
# File 'lib/ridl/node.rb', line 2243 def initialize(_name, _enclosure, params) super(_name, _enclosure) @idltype = params[:type] @oneway = (params[:oneway] == true) @in = [] @out = [] @raises = [] @context = nil unless @idltype.is_a?(IDL::Type::ScopedName) && @idltype.is_node?(IDL::AST::TemplateParam) raise RuntimeError, "Anonymous type definitions are not allowed!" if params[:type].is_anonymous? if @idltype.is_local? if _enclosure.is_a?(IDL::AST::Interface) && !_enclosure.is_local? raise RuntimeError, "Local type #{@idltype.typename} not allowed for operation on unrestricted interface" end ## IDL_Valuetype: no problem as valuetype operations are local end if !@idltype.is_complete? if _enclosure.is_a?(IDL::AST::Interface) raise RuntimeError, "Incomplete type #{@idltype.typename} not allowed here!" end ## IDL_Valuetype: no problem as valuetype operations are local end end end |
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
2241 2242 2243 |
# File 'lib/ridl/node.rb', line 2241 def context @context end |
#idltype ⇒ Object (readonly)
Returns the value of attribute idltype.
2240 2241 2242 |
# File 'lib/ridl/node.rb', line 2240 def idltype @idltype end |
#oneway ⇒ Object (readonly)
Returns the value of attribute oneway.
2240 2241 2242 |
# File 'lib/ridl/node.rb', line 2240 def oneway @oneway end |
#raises ⇒ Object
Returns the value of attribute raises.
2240 2241 2242 |
# File 'lib/ridl/node.rb', line 2240 def raises @raises end |
Instance Method Details
#define(*args) ⇒ Object
2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 |
# File 'lib/ridl/node.rb', line 2303 def define(*args) param = super(*args) case param.attribute when Parameter::IN @in << param when Parameter::OUT @out << param when Parameter::INOUT @in << param @out << param end param end |
#in_params ⇒ Object
2317 2318 2319 |
# File 'lib/ridl/node.rb', line 2317 def in_params @in end |
#instantiate(_context, _enclosure) ⇒ Object
2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 |
# File 'lib/ridl/node.rb', line 2282 def instantiate(_context, _enclosure) _params = { :type => @idltype.instantiate(_context), :oneway => @oneway, } _op = super(_context, _enclosure, _params) _op.raises = self.concrete_raises(_context) _op.context = @context _op end |
#marshal_dump ⇒ Object
2268 2269 2270 |
# File 'lib/ridl/node.rb', line 2268 def marshal_dump super() << @idltype << @oneway << @in << @out << @raises << @context end |
#marshal_load(vars) ⇒ Object
2272 2273 2274 2275 2276 2277 2278 2279 2280 |
# File 'lib/ridl/node.rb', line 2272 def marshal_load(vars) @context = vars.pop @raises = vars.pop @out = vars.pop @in = vars.pop @oneway = vars.pop @idltype = vars.pop super(vars) end |
#out_params ⇒ Object
2320 2321 2322 |
# File 'lib/ridl/node.rb', line 2320 def out_params @out end |
#params ⇒ Object
2323 2324 2325 |
# File 'lib/ridl/node.rb', line 2323 def params self.children end |