Skip to content

Commit

Permalink
Check in manager class
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffxy committed Jan 22, 2025
1 parent 87780fb commit d202dc8
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/brad/vdbe/manager.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import pathlib
from typing import List
from brad.vdbe.models import VirtualInfrastructure, VirtualEngine


class VdbeManager:
"""
Used to manage the current VDBE state.
"""

@classmethod
def load_from(cls, serialized_infra_json: pathlib.Path) -> "VdbeManager":
with open(serialized_infra_json, "r", encoding="utf-8") as f:
infra = VirtualInfrastructure.model_validate_json(f.read())
return cls(infra)

def __init__(self, infra: VirtualInfrastructure) -> None:
self._infra = infra

def infra(self) -> VirtualInfrastructure:
return self._infra

def engines(self) -> List[VirtualEngine]:
return self._infra.engines

0 comments on commit d202dc8

Please sign in to comment.