Skip to content

Commit

Permalink
refactoring WIP draft ideas
Browse files Browse the repository at this point in the history
  • Loading branch information
loulecrivain committed Feb 5, 2025
1 parent 25243ca commit b602646
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions cosmo/serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,30 @@ def serialize(self):
return device_stub


class SwitchElement(abc.ABC):
@abc.abstractmethod
def serialize():
pass

class SwitchElementCompound(SwitchElement):
# children is a list
def add(c: SwitchElement):
raise NotImplemented

def remove(c: SwitchElement):
raise NotImplemented

def getChildren(c: SwitchElement):
raise NotImplemented

def serialize():
raise NotImplemented

class InterfaceSwitchElement(SwitchElement):
def serialize():
raise NotImplemented


class SwitchSerializer:
def __init__(self, device):
self.device = device
Expand Down

0 comments on commit b602646

Please sign in to comment.