text stringlengths 0 234 |
|---|
is |
use type Version_Trees.Version; |
Time : Version_Trees.Version := To; |
begin |
if Self.Document.History.Is_Changing (To) then |
-- Self.LC doesn't contain Local_Changes for Is_Changing version yet |
-- Take it from Self.Nested_Changes |
if Self.Local_Changes > 0 then |
return True; |
elsif Time = From then |
return False; |
end if; |
Time := Self.Document.History.Parent (Time); |
end if; |
while Time /= From loop |
if Versioned_Booleans.Get (Self.LC, Time) then |
return True; |
end if; |
Time := Self.Document.History.Parent (Time); |
end loop; |
return False; |
end Local_Changes; |
--------------------------- |
-- Mark_Deleted_Children -- |
--------------------------- |
procedure Mark_Deleted_Children (Self : in out Node'Class) is |
function Find_Root (Node : Node_Access) return Node_Access; |
-- Find top root accessible from the Node |
procedure Delete_Tree |
(Node : not null Node_Access; |
Parent : Node_Access; |
Index : Positive); |
-- Check Node if it's disjointed from ultra-root. |
-- Delete a subtree rooted from Node if so. |
-- If Parent /= null also set Parent.Child(Index) to null. |
Now : constant Version_Trees.Version := Self.Document.History.Changing; |
----------------- |
-- In_The_Tree -- |
----------------- |
function Find_Root (Node : Node_Access) return Node_Access is |
Child : not null Nodes.Node_Access := Node; |
begin |
loop |
declare |
Parent : constant Nodes.Node_Access := Child.Parent (Now); |
begin |
if Parent = null then |
return Child; |
else |
Child := Parent; |
end if; |
Function Definition: procedure Main is |
Function Body: begin |
-- Guide: http://archive.adaic.com/standards/83lrm/html/lrm-11-01.html |
declare |
PP : Positive; |
P2 : Positive; |
begin |
P2 := 5; |
PP := 3 - P2; -- intentionally violate Positive range constraint |
exception |
when Constraint_Error => |
Put_Line("HANDLED: violate range constraint gives Constraint_Error"); |
Function Definition: procedure Unchecked_Free is new Ada.Unchecked_Deallocation |
Function Body: (Agent_Impl, Agent_Impl_Ptr); |
pragma Warnings (Off, "*redundant conversion*"); |
Ptr : Agent_Impl_Ptr := Agent_Impl (Object.all)'Access; |
pragma Warnings (On, "*redundant conversion*"); |
begin |
Unchecked_Free (Ptr); |
end Destroy; |
procedure Find (Object : in out Agent_Impl; |
Session : in out ADO.Sessions.Session'Class; |
Query : in ADO.SQL.Query'Class; |
Found : out Boolean) is |
Stmt : ADO.Statements.Query_Statement |
:= Session.Create_Statement (Query, AGENT_DEF'Access); |
begin |
Stmt.Execute; |
if Stmt.Has_Elements then |
Object.Load (Stmt, Session); |
Stmt.Next; |
Found := not Stmt.Has_Elements; |
else |
Found := False; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.